go-http-file-server icon indicating copy to clipboard operation
go-http-file-server copied to clipboard

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

Open 107295472 opened this issue 1 year ago • 5 comments

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

107295472 avatar Sep 11 '24 00:09 107295472

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

107295472 avatar Sep 11 '24 01:09 107295472

只能命令行上传啊,我想用前端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

marjune163 avatar Sep 13 '24 16:09 marjune163

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

107295472 avatar Sep 18 '24 01:09 107295472

image

107295472 avatar Sep 18 '24 01:09 107295472

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

marjune163 avatar Sep 18 '24 02:09 marjune163