Newer Version Available
Users Files, General
Upload a file, including references to external files, to
the Files home or get information about files a user owns. These files don’t include
files shared with a user, files a user follows, or general organization
files.
When you upload a file to the Files home, it is private and available only to the file owner.
To upload a file, send it in a multipart/form-data request. You can include the description and title of the file in the multipart/form-data request as a JSON or XML request body. You can also send the information as request parameters. For information about how to create the multipart/form-data message, see Uploading Binary Files.
- Resource
-
- Available since version
- 36.0
- In versions 24.0–35.0, use /chatter/users/userId/files and /connect/communities/communityId/chatter/users/userId/files, which require Chatter.
- Requires Chatter
- No
- HTTP methods
- GET, POST, or HEAD
- Request body for POST
-
- To upload a file, provide the binary file in a multipart/form-data body part where name="fileData". See Uploading Binary Files.
- Root XML tag
- <fileInput>
- JSON
-
- Properties
-
- Request parameters for POST
-
- Request parameters for GET
-
Parameter Name Type Description Available Since page Integer An integer specifying a page of items. The default value is 0, which returns the first page. 24.0 pageSize Integer Specifies the number of items per page. Valid values are from 1 through 100. If you don't specify a size, the default is 25. 24.0 q String A query string to filter the results. The string must contain at least two characters, not including wildcards. For information about wildcards, see Wildcards. 27.0 - Response body for GET
- File Summary Page
- Response body for POST
- File Summary
- Example POST request
- This example creates a file and uploads it to Salesforce. The example shows the body parts in a
multipart/form-data request. The first body part is a File Input request body. The
second is the content of the file. For more information, see Uploading Binary Files.