Uploading Files

Native mobile platforms support a method for uploading a file. You provide a path to the local file to be uploaded, the name or title of the file, and a description. If you know the MIME type, you can specify that as well. The upload method returns a platform-specific request object that can upload the file to the server. When you send this request to the server, the server creates a file with version set to 1.

Use the following methods for the given app type:

Android Native 

Upload Method 

1FileRequests.uploadFile()

Signature 

1public static RestRequest
2uploadFile(
3File theFile,
4String name,
5String description,
6String mimeType)
7throws UnsupportedEncodingException

iOS Native 

Upload Method 

1- requestForUploadFile:
2name:description:mimeType:

Signature 

1- (SFRestRequest *)
2requestForUploadFile:(NSData *)data
3name:(NSString *)name
4description:(NSString *)description
5mimeType:(NSString *)mimeType

We've Moved

Welcome to the new home of the Mobile SDK Developer Guide! For now, the Japanese guide can be found in PDF form.