Closed ilanni2460 closed 6 months ago
yes, it does. Refer to https://hfs-3.apidog.io/
for authentication you can use standard http authentication, possibly with https to avoid clear-text passwords
@rejetto Thank you very much for your reply. I used the following method to upload files, but still got an error.
curl -X POST --header 'x-hfs-anti-csrf: 1' -u "admin:P@qqq" -H "Content-Type: application/octet-stream" --data-binary "@/root/a.txt" http://127.0.0.1/soft/
Use this method to report an error,this log:
Bad Request
thanks for reporting! i will now update the documentation to specify that POST requires multipart, while PUT doesn't. Refer to this to know correct usage with curl https://github.com/rejetto/hfs/wiki/Upload#from-command-line
@rejetto OK, all right. By the way, I would like to ask again, how to overwrite existing files when uploading through API
do you want all uploads to always overwrite?
@rejetto I will cover it often。always overwrite。
then you may want to just change this option
otherwise, you can see that i just updated API documentation to include overwrite
@rejetto Thank you very much, that's definitely covered.
@rejetto
This is my command to upload files. Because the authentication method is not enabled, I achieve the purpose by setting the access permissions of the directory. Everyone can upload it, and only designated people can view/modify and delete it.
curl -F upload=@a.txt http://192.168.70.193/soft/software_list/
you don't need authentication, or you can't make it work?
@rejetto Haha, it doesn't matter. I don't upload files through authentication now. I can achieve my purpose by just specifying the access rights to the directory. Thank you very much for your timely answer.
Does hfs support uploading files through api, and uploading files must pass authentication