uploadFile

suspend fun uploadFile(fileName: String, fileContent: ByteArray, 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

fileName

File name.

fileContent

Bytes of file data

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.