rejetto / hfs

HFS is a web file server to run on your computer. Share folders or even a single file thanks to the virtual file system.
GNU General Public License v3.0
2.29k stars 227 forks source link

Can users use your API to list and upload files? thanks #391

Closed JH6588 closed 1 year ago

JH6588 commented 1 year ago

We need to upload some files periodically in a script. Do you support API? thanks

rejetto commented 1 year ago

the API is not documented yet, I will work on it, possibly on swagger but for the upload part you can refer to https://github.com/rejetto/hfs/wiki/Upload

for the list you can make an http GET to the url http://localhost/~/api/get_file_list?uri=%2F

the uri is the parameter controlling the folder, and is url-encoded. %2F is actually "/" Encode using encodeURIComponent(path)

the response is a json object with "list" in it, that's an array of objects. Each entry has at least "n", that is the name.

rejetto commented 1 year ago

i started writing proper documentation https://app.swaggerhub.com/apis-docs/rejetto/HFS/1.0.0

rejetto commented 1 year ago

just added this page https://github.com/rejetto/hfs/wiki/APIs

JH6588 commented 1 year ago

in my case .The directory is not public .It's only opened for specific account. the document didn't handle account authentication. It's ok to send http request with cookies follow the chrome network panel . .I wonder is there a good way do this .tks