Files.fm Cloud Storage API (V1) — Ask us for V2

Files.fm supports the WebDAV file management protocol and HTTPS-based REST requests (GET/POST). Below is a short “quick start” showing how to upload files into a user’s storage using simple HTTP calls. You must create a user account first. (Anonymous uploads are also possible without login, but they are typically kept for up to 2 months and may be subject to additional security limits.)


Quick start (TL;DR)

1) Create a folder (get_upload_id.php). This call returns the folder HASH and the EDIT and ADD keys. The HASH is used to reference folders and files, for example: 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=LINK

Set folder access with access_type: PRIVATE | LINK (LINK means anyone with the hash can access it).

2) Upload files (save_file.php via HTTP POST). Provide the target folder hash (up_id) and the corresponding EDIT or ADD key.

https://api.files.fm/save_file.php?up_id=trgkzgp&key=a3f8a&get_file_hash

cURL examples (Linux / Windows):

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"

On success, save_file.php returns the file hash (or the letter “d”).
Files must be uploaded sequentially, one by one (one POST request per file).

3) List folder contents (by upload hash):

https://api.files.fm/api/get_file_list_for_upload.php?hash=polcdti

4) Download a file (by file hash):

https://api.files.fm/down.php?i=jyphxsb

5) User login (create session token + cookies and get ROOT folder keys):

https://api.files.fm/api/login.php?user=demo&pass=demo

Need embedded content, a JavaScript uploader, custom features, or help? Contact us at 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=jyphxsb
There are limitations and other methods exist as well. Contact us.
Get small image thumbnail File hash.
https://api.files.fm/thumb.php?i=zzmmssgg
Approx 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=demo
Approx 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=polcdti
For 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.php
Purpose:
To delete hash=hash & del_key=del_key file
Call example:
https://api.files.fm/api/delete_file.php?hash=abchef&del_key=123456
A 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=demo
Returns PHPSESSID, user details, ROOT folder or error:no_user
Test user session
https://api.files.fm/api/test_session.php
Prints _COOKIE and _SESSION arrays.
Create new user account
https://api.files.fm/api/register.php
?user=tester123&pass=tester123&email=tester123@test.com&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=LINK
access_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=fkf4m8yc
A 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_hash
key == 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.php
Purpose:
Returns delete and add_file keys for the upload
Call example:
https://api.files.fm/api/get_upload_keys.php?hash=polcdti&user=demo&pass=demo
A 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=1
Purpose:
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=1
A 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.php
Purpose:
Returns all subdirectories and their contents: files and subdirectories + metadata.

Call example:
https://api.files.fm/api/get_upload_tree.php?Hash=eklywcn&DeleteKey=f686ee67
A 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.php
Purpose:
Returns ROOT folder's direct childs - files and folders + metadata (without add/delete keys):
hash, date, description, file count, total size, views, valid_to_date
Call example:
https://api.files.fm/api/upload_list.php?user=demo&pass=demo
A 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.php
Purpose:
Returns folder's add_file_key 
Call example:
https://api.files.fm/api/get_add_key.php?hash=polcdti
A 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.php
Purpose:
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.txt
A 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.