Upload - rejetto/hfs GitHub Wiki

Basics

To allow uploads you need a folder that is actually on your disk, where the files will be stored.

Instructions

  1. go to Admin-panel > Shared files
  2. add a folder
  3. be sure it is bound to a folder on disk (the field is called Load content from disk)
  4. click on "Who can upload", and decide the policy you desire

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/.

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.

See swagger