Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,113 of 9,113 pages
About the help in other languages
All help pages

Files and uploads

Download files from Exponential in an app (expfile services, the content/download URL, time-limited signed links for clients without a session) and why uploading photos or files from a device needs a custom endpoint…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/mobile-app-developers/media-and-images/files-and-uploads.md

On this page

Files and uploads

This page is for app developers whose app opens documents (PDFs, brochures) from Exponential, or would like to let users send photos and files. Downloads are covered by the remote services; uploads are not, and this page says what to do instead.

Contents

  1. Downloading files
  2. Uploads: what is and is not there
  3. A brief for an upload endpoint

Downloading files

File fields (datatype ezbinaryfile) come through REST as the datatype's string form. For an app, the expfile services are clearer (declared in extension/expservices/classes/media/expfileservices.php):

ServiceArgumentsGives
expfile::attributesnode idthe file fields of a node, with has_content
expfile::infonode id, field identifiernames, MIME type, size, download count
expfile::downloadurlnode id, field identifierurl and absolute_url of the site's content/download address; the download itself checks content/read
expfile::signedurlnode id, field identifier, secondsa time-limited signed link, described as "for clients without a session"

The content/download address checks the rights of the requesting user, and a native app usually has no site session; that is what the signed link is for. Ask for it just before opening the file, with a short lifetime, and do not store it.

Uploads: what is and is not there

  • REST create and update take field values as form fields or a JSON body and have no file upload. A file field (ezimage, ezbinaryfile, ezmedia) takes a public http(s) URL, optionally <URL>|<alternative text or file name>, that the server downloads (no server path, no private network address, no redirects, at most 50 MB; ezprestapi 1.2.9) (Creating and removing content).
  • expservices refuses remote writes to the datatypes ezimage, ezbinaryfile, ezmedia, ezuser, ezpassword and ezflowblock, "whose fromString() reads a local path or URL, or that hold credentials" (expContentBase::$deniedInputTypes).
  • No service in the shipped catalog takes an uploaded file (the expfile::safename service only checks a file name).

So an app that sends photos, voice notes or documents needs an endpoint built for it.

A brief for an upload endpoint

For the application creator who builds it (as a REST provider, an expservices domain or a module view; see Your own REST provider and Forms, CSRF protection and HTTP input):

  • multipart upload of one file per request, with a maximum size and a list of allowed types, checked by content and not only by extension;
  • the user it runs as, and the folder and class it creates (for example an image object below an "App uploads" folder), checked with content/create like every other write;
  • an answer with the new node id, and a clear 413 or 415-style error for files that are too large or of the wrong type;
  • no file read from a URL or a server path supplied by the client;
  • moderation: uploads land unpublished or in a section only editors see, if users are not trusted.

In the app: resize photos before upload, upload on Wi-Fi where the user prefers it, and retry an interrupted upload from the start.

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x