b2UploadFile | R Documentation |
b2Uploadfile
Uploads one file to the user's account B2.
b2UploadFile(authToken, uploadUrl, fileName)
authToken |
A unique authorisation token permiting the upload of files
to B2. An authorisation token is obtained from |
uploadUrl |
A unique URL permiting the upload of files to B2. An upload
URL is obtained from |
fileName |
The name of the file to be uploaded. Files must be located in the current working directory. A complete list of supported file types may be found in the b2FileTypes.rds file located in this package's data directory, or at the following location: https://www.backblaze.com/b2/docs/content-types.html |
This function uploads one file to the user's account on the Backblaze B2
cloud storage product, returning a unique file ID. Files cannot be uploaded
to B2 unless GetUploadUrl
has been executed first, specifying the
bucket in which to upload the file. Further details regarding this API call
are available here:
https://www.backblaze.com/b2/docs/b2_upload_file.html
authToken
, uploadUrl
and fileName
are mandatory and must
be user defined.
If successful a list containing the fileId
, fileName
,
accountId
, bucketId
, contentLength
,
contentSha1
, contentType
and fileInfo
will all be
echoed back to the user.
## Not run:
# Make a bucket Private
# Get Upload URL
uploadUrlReturn <- b2GetUploadUrl(bucketId = "aUniqueBucketId")
uploadUrl <- uploadUrlReturn$uploadUrl
authToken <- uploadUrlReturn$authorizationToken
# Upload file
b2UploadFile(authToken, uploadUrl, fileName = "yourFileName.png")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.