uploadFile

suspend fun GofileClient.uploadFile(file: File, token: String? = null, folderId: String? = null, server: String? = null): Result<GofileUploadFileResponse>

Upload one file on a specific server. If you specify a folderId, the file will be added to this folder.

https://{server}.gofile.io/uploadFile

Parameters

file

File to upload. It will get contentType based on this.

token

The access token of an account. Can be retrieved from the profile page. If valid, the file will be added to this account. If undefined, a guest account will be created to receive the file.

folderId

The ID of a folder. If valid, the file will be added to this folder. If undefined, a new folder will be created to receive the file. When using the folderId, you must pass the account token.

server

Server to upload to. If you specify null, it will use the best available.


suspend fun GofileClient.uploadFile(file: File, contentType: String, token: String? = null, folderId: String? = null, server: String? = null): Result<GofileUploadFileResponse>

Upload one file on a specific server. If you specify a folderId, the file will be added to this folder.

https://{server}.gofile.io/uploadFile

Parameters

file

File to upload.

contentType

A two-part identifier for file formats and format contents transmitted on the Internet. See also media-types

token

The access token of an account. Can be retrieved from the profile page. If valid, the file will be added to this account. If undefined, a guest account will be created to receive the file.

folderId

The ID of a folder. If valid, the file will be added to this folder. If undefined, a new folder will be created to receive the file. When using the folderId, you must pass the account token.

server

Server to upload to. If you specify null, it will use the best available.