R6 Class representing a resource for managing files' uploads.
Public fields
URLList of URL endpoints for this resource.
upload_idUpload ID received after upload initialization.
pathRelative or absolute path to the file on the local disk.
projectProject's identifier (character).
parentThe ID of the folder to which the item is being uploaded. Should not be used together with 'project'.
filenameFile name. By default it will be the same as the name of the file you want to upload. However, it can be changed to new name.
overwriteIf
TRUEwill overwrite file on the server.file_sizeFile size.
part_sizeSize of part in bytes.
part_lengthNumber of parts to upload.
partsList of parts to be uploaded (class
Part).initializedIf
TRUE, upload has been initialized.authAuthentication object.
Methods
Method new()
Create a new Upload object.
Arguments
pathPath to the file on the local disc.
projectProject's identifier (character).
parentThe ID of the folder to which the item is being uploaded.
filenameNew file name. Optional.
overwriteIf true will overwrite file on the server.
file_sizeFile size.
part_sizeSize of a single part in bytes.
initializedIf
TRUE, upload has been initialized.authSeven Bridges Authentication object.
Method print()
Print method for Upload class.
Method info()
Get the details of an active multipart upload.
Examples
## ------------------------------------------------
## Method `Upload$print`
## ------------------------------------------------
if (FALSE) { # \dontrun{
upload_object <- Upload$new(
path = "path/to/my/file.txt",
project = project_object,
auth = auth
)
# Print the upload object information
upload_object$print(name = name)
} # }
## ------------------------------------------------
## Method `Upload$init`
## ------------------------------------------------
if (FALSE) { # \dontrun{
upload_object <- Upload$new(
path = "path/to/my/file.txt",
project = project_object,
auth = auth
)
# Initialize multipart file upload object
upload_object$init()
} # }
## ------------------------------------------------
## Method `Upload$info`
## ------------------------------------------------
if (FALSE) { # \dontrun{
upload_object <- Upload$new(
path = "path/to/my/file.txt",
project = project_object,
auth = auth
)
# Get upload job status information
upload_object$info()
} # }
## ------------------------------------------------
## Method `Upload$start`
## ------------------------------------------------
if (FALSE) { # \dontrun{
upload_object <- Upload$new(
path = "path/to/my/file.txt",
project = project_object,
auth = auth
)
# Initialize multipart file upload object
upload_object$init()
# Start upload process
upload_object$start()
} # }
## ------------------------------------------------
## Method `Upload$abort`
## ------------------------------------------------
if (FALSE) { # \dontrun{
upload_object <- Upload$new(
path = "path/to/my/file.txt",
project = project_object,
auth = auth
)
# Abort upload process
upload_object$abort()
} # }