Upload - rejetto/hfs GitHub Wiki
Uploads are disabled by default. Enable uploads by setting permissions.
Basics
To allow uploads you need a folder that is actually on your disk, where the files will be stored.
Instructions
- go to Admin-panel > Shared files
- add a folder, or choose an existing one
- be sure it is bound to a folder on disk (the field is called Disk source)
- click on "Who can upload", and decide who must be allowed to upload
Done! From now on, users with permission (decided by you on step 3) will see a button "upload" when they access such folder
From command line
It is possible to upload a file without using HFS' web interface.
At command line you can use curl -T FILE URL/, where FILE is the path of the file you want to upload, and URL is the destination folder in HFS. It also works in this other way curl -F upload=@FILE URL/. You can pass credentials with parameter -u.
API
From any programming language you can make an HTTP request. Using method PUT, the URL must include folder and filename, while the body will contain exactly the content of the file. If you want to use method POST, it will be treated as a form multipart. The URL must include the folder only, with final slash, the name of the field in the form is ignored, while the file name is read from Content-Disposition of the multipart.