Files.fm Cloud File Storage API
We support WebDAV file management protocol and web GET/POST REST calls via https. Below are short version of initial steps, how to upload files to a specific user's storage via HTTP GET and POST requests. You have to create user account at first. (You can do "anonymous" uploads without login, but those will be valid 2 months maximum and are subjects to security limits.)
Quick manual (TLDR)
1) CREATE new folder via get_upload_id.php. This call returns the folder's HASH and EDIT and ADD keys. Hash is used to reference a folder or file: https://files.fm/u/zqrffeh or https://files.fm/f/$filehash
https://api.files.fm/api/get_upload_id.php?user=demo&pass=demo&folder_name=my_folder_name&access_type=LINKThe folder can be set private or accessible to anyone who knows the hash: access_type=PRIVATE|LINK
2) UPLOAD each file via HTTP POST to "save_file.php", providing target folder's hash and the corresponding Edit or Add key:
https://api.files.fm/save_file.php?up_id=trgkzgp&key=a3f8a&get_file_hash
Linux / Windows command line example for scripts:
curl -i -F 'file=@/tmp/local-file.txt' 'https://api.files.fm/save_file.php?up_id=hash&key=add_key'
curl -i -F 'file=@/tmp/local-file.txt' 'https://api.files.fm/save_file.php?up_id=jjqcank7&key=05123&get_file_hash'
Windows: curl -i -F file="@C:\temp\test.txt" "https://api.files.fm/save_file.php?up_id=jjqcank7&key=05123"If file upload is successful, save_file.php will return file's hash (or letter 'd').
Files must be uploaded sequentially, one by one. This means, for each file that you want to upload, you must POST it to save_file.php
3) LIST folder contents by providing upload hash:
https://api.files.fm/api/get_file_list_for_upload.php?hash=polcdti
4) DOWNLOAD a particular file providing it's hash:
https://api.files.fm/down.php?i=jyphxsb
5) User login: create session ID token and cookies, get ROOT folder's keys: https://api.files.fm/api/login.php?user=demo&pass=demo
If you need to embed content, JS file uploader, custom features or help, contact us via https://files.fm/contacts
POST/GET API Usage and examples
To receive full and up to date API V2 documentation, contact us via https://files.fm/contacts
Operation | Requirements | Usage |
---|---|---|
Download file | File hash. File access can be PRIVATE or with a LINK. Direct downloads are limited, depending on account type (PRO, BUSINESS, ENTERPRISE) and security settings. |
Call:
https://api.files.fm/api_v2/download_file + file_hash in POST.
Compatibility GET: https://api.files.fm/down.php?i=jyphxsbThere are limitations and other methods exist as well. Contact us. |
Get small image thumbnail | File hash. |
https://api.files.fm/thumb.php?i=zzmmssggApprox size of the thumbnail: 400x271px |
Get large thumbnails of Images. Thumbs exist for videos, audio, folders and other files, if set. | File or Folder hash. |
https://api.files.fm/thumb_show.php?i=zzmmssgg https://api.files.fm/thumb_video_picture.php?i=d76zz7kb https://api.files.fm/thumb_folder.php?i=demoApprox size of large thumbnails: 1500 px |
Get streamable video preview | File hash. Contact us. | Generated MP4 preview file in HD quality (or custom). Watermarked, if file has a price set. |
Get document PDF preview | File hash. Contact us. | PDF file for DOC, XLS, EDOC, ZIP documents. |
Get all files in ZIP archive | Folder hash. Limits exist. |
https://api.files.fm/server_scripts/zip/zip_streamer/upload_zip_streamer.php?uhash=polcdtiFor folder with password add "password" parameter: https://api.files.fm/server_scripts/zip/zip_streamer/upload_zip_streamer.php?uhash=polcdti&password=my_password |
A sharing link to display folder's or file contents in a browser (for end users to access and preview content) |
Folder or file hash.
You can choose your language |
[EN] https://files.fm/u/uploadhash [EN] https://files.fm/f/filehash [EN] https://files.fm/u/demo [EN] https://files.fm/f/demo [ES] https://es.files.fm/u/demo [DE] https://de.files.fm/u/demo |
DELETE folder (including all files and subdirectories):
Undelete exists for Pro/Business/Enterprise accounts. |
Folder hash and delete key. | https://api.files.fm/api_v2/delete_folder + POST folder_hash
Compatibility: https://api.files.fm/list.php?i=hash&k=delkey&t=ok |
DELETE file
Undelete exists for Pro/Business/Enterprise accounts. |
file hash and delete key (either for parent folder or just this file) |
https://api.files.fm/api/delete_file.phpPurpose: To delete hash=hash & del_key=del_key fileCall example: https://api.files.fm/api/delete_file.php?hash=abchef&del_key=123456A successful result in JSON format: {"success":1}Error result: {"success":0}Compatibility/old: https://api.files.fm/list.php?i=hash&k=delkey&f=filehash |
User LOGIN and session setup. Basic HTTP authentication, GET and POST methods supported. | user and pass variables. Username or email can be used. |
https://api.files.fm/api/login.php?user=demo&pass=demoReturns PHPSESSID, user details, ROOT folder or error:no_user |
Test user session |
https://api.files.fm/api/test_session.phpPrints _COOKIE and _SESSION arrays. |
|
Create new user account |
https://api.files.fm/api/register.php[email protected]&source=devapi&lang=en |
|
CREATE NEW FOLDER in ROOT or specified subdirectory. | username, pass, desired folder name and target directory. (ROOT, if omitted). |
https://api.files.fm/api_v2/create_folder + POST parent_folder_hash + folder_name
Compatibility/GET: https://api.files.fm/api/get_upload_id.php?parent_hash&access_type=LINKaccess_type=PRIVATE|LINK Purpose: Creates new folder and returns new hash with add/modification keys. If no user is specified, the folder does not belong to anyone and will be automatically deleted after 1 month. Call example: Simplest case (anonymous): https://api.files.fm/api/get_upload_id.php
For specified user, target parent folder and folder's name: https://api.files.fm/api/get_upload_id.php?user=demo&pass=demo&folder_name=My_Folder_Name&parent_hash=fkf4m8ycA successful result in JSON format: {"hash":"rbzztfm", "delete_key":"0fe4108e", "add_key":"63dfe", "UserID":11315}{"hash":"vdidqcw", "delete_key":"789e5ed4", "add_key":"b0977", "UserID":44961, "FolderName":"my_foldername"}If used without user (anonymously), then UserID=false |
UPLOAD FILE to folder.
Supports file update and access to previous file versions for Bussiness/Eneterprise accounts. |
Provide folder's hash and Add key (have to be known/stored before) |
https://api.files.fm/api_v2/upload_file + POST folder_hash
Compatibility: https://api.files.fm/save_file.php?up_id=trgkzgp&key=a3f8a&get_file_hashkey == add_key (you receive folder's keys, when you create a new folder) Upload files one by one. |
REPLACE file. | Provide hash, keys, do=update, replace_file_hash. Supports file versions. Etag changes. |
Pass do=update, replace_file_hash. Contact us.
https://api.files.fm/save_file.php?up_id=trgkzgp&key=a3f8a |
Get folder's "Delete" and "Add" file keys, which are REQUIRED to access, upload, modify or delete content. | username and pass + folder hash |
https://api.files.fm/api/get_upload_keys.phpPurpose: Returns delete and add_file keys for the uploadCall example: https://api.files.fm/api/get_upload_keys.php?hash=polcdti&user=demo&pass=demoA successful result in JSON format: {"AddFileKey":"3e7ee", "DeleteKey":"4d7bb256"} |
LIST folder contents. Get direct child files and folders + metadata (wtihtout sub-sub-folders). | Upload hash (Folder's access rights are can be set to LINK, PUBLIC or PRIVATE). |
https://api.files.fm/api/get_file_list_for_upload.php?include_folders=1Purpose: Returns file/folder list and metadata for each file: file hash, name, size, mime_type, etag: Call example: https://api.files.fm/api/get_file_list_for_upload.php?hash=demo&include_folders=1A successful result in JSON format: [{"hash":"jyphxsb", "name":"File1.jpg", "Size":"106361"}, {"hash":"yewpddm", "name":"File2.jpg", "Size":"62249"}]No files: [] |
Get FULL directory and file tree (recursive structure) | ROOT folder or subfolder (upload) hash + folder's DeleteKey |
https://api.files.fm/api/get_upload_tree.phpPurpose: Returns all subdirectories and their contents: files and subdirectories + metadata. Call example: https://api.files.fm/api/get_upload_tree.php?Hash=eklywcn&DeleteKey=f686ee67A successful result in JSON format: {"error":null, "data":{"Type":"Folder", "ID":"4759592", "Hash":"eklywcn", "AddFileKey":"30ae5", "DeleteKey":"f686ee67", "ParentID":"4962316", "CreatedDate":"2014-02-20 22:55:30", "ModifiedDate":null, "Name":"eklywcn1", "Children":[{"Type":"Folder", "ID":"4799549", "Hash":"gvznfga", "AddFileKey":"e5a1f", "DeleteKey":"d94bf9b9", "ParentID":"4759592", "CreatedDate":"2014-03-01 18:50:13", "ModifiedDate":null, "Name":"aaabbbcccd112233", "Children":false}]}} |
List user's ROOT folder child contents - file and folder metadata, including ROOT folder's hash. | Provide username and pass |
https://api.files.fm/api/upload_list.phpPurpose: Returns ROOT folder's direct childs - files and folders + metadata (without add/delete keys): hash, date, description, file count, total size, views, valid_to_dateCall example: https://api.files.fm/api/upload_list.php?user=demo&pass=demoA successful result in JSON format: [{"hash":"polcdti", "date":"2012-12-05 19:00:19", "description":"", "files":"2", "size":"168610", "views":"1", "valid_to_date":""}, {"hash":"mwwrcqc", "date":"2012-12-05 18:59:18", "description":"", "files":"1", "size":"106361", "views":"1", "valid_to_date":""}] |
List add_key which is REQUIRED to upload files to a specific folder (but not delete/edit existing) | Active user session |
https://api.files.fm/api/get_add_key.phpPurpose: Returns folder's add_file_keyCall example: https://api.files.fm/api/get_add_key.php?hash=polcdtiA successful result in JSON format: {"add_key":"3e7ee"} |
Get file edit key. Folder's edit key works as well if you have it. | Contact us | api/get_file_keys.php |
Rename a file | File's hash and parent folder's hash. |
https://api.files.fm/api/change_file.phpPurpose: Updates a file's name.Call example: https://api.files.fm/api/change_file.php?file_hash=polcdti&folder_hash=nstimcht&file_display_name=NewFileName.txtA successful result in JSON format: {"Success":true,"Error":null,"Message":"Fields updated"} |
eParaksts, e-signing and signatures, user identification | Contact us. | Contact us to receive full documentation and custom options. |
Search | Contact us. | https://api.files.fm/api/get_upload_tree.php |
Content and gallery embedding, file uploader, iframes, video/audio player etc | Contact us. | Contact us to receive full documentation and custom options. |