Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

可以用http代码上传文件吗? #46

Open
107295472 opened this issue Sep 11, 2024 · 5 comments
Open

可以用http代码上传文件吗? #46

107295472 opened this issue Sep 11, 2024 · 5 comments

Comments

@107295472
Copy link

107295472 commented Sep 11, 2024

只能命令行上传啊,我想用前端js上传文件

@107295472
Copy link
Author

可以自动创建目录吗,根据时间日期

@marjune163
Copy link
Collaborator

marjune163 commented Sep 13, 2024

只能命令行上传啊,我想用前端js上传文件

可以的,用POST提交,详见API文档:
https://github.com/mjpclab/go-http-file-server/blob/main/doc/zh-CN/api.md#%E5%9C%A8%E6%8C%87%E5%AE%9A%E8%B7%AF%E5%BE%84%E4%B8%8B%E5%88%9B%E5%BB%BA%E7%9B%AE%E5%BD%95

@107295472
Copy link
Author

107295472 commented Sep 18, 2024

image
base auth不通过,用这个命令启动的ghfs -l 8080 -r files --auth files --user user1:pass1 -L -

@107295472
Copy link
Author

image

@marjune163
Copy link
Collaborator

  • 需要用 --upload--upload-dir 选项指定可上传的目录
  • --auth 后面指定的是URL路径,也就是实际出现在浏览器地址栏中的路径,所以应该用 --auth /。也可以用 --auth-dir files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants