| Upload | R Documentation |
R6 Class representing a resource for managing files' uploads.
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 TRUE will 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.
new()Create a new Upload object.
Upload$new(
path = NA,
project = NA,
parent = NA,
filename = NA,
overwrite = FALSE,
file_size = NA,
part_size = getOption("sevenbridges2")$RECOMMENDED_PART_SIZE,
initialized = FALSE,
auth = NA
)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.
print()Print method for Upload class.
Upload$print()
\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)
}
init()Initialize a new multipart file upload.
Upload$init()
\dontrun{
upload_object <- Upload$new(
path = "path/to/my/file.txt",
project = project_object,
auth = auth
)
# Initialize multipart file upload object
upload_object$init()
}
info()Get the details of an active multipart upload.
Upload$info(list_parts = FALSE)
list_partsIf TRUE, also return a list of parts
that have been reported as completed for this multipart upload.
Please bear in mind that the output could be heavy for printing if
there are lot of parts.
\dontrun{
upload_object <- Upload$new(
path = "path/to/my/file.txt",
project = project_object,
auth = auth
)
# Get upload job status information
upload_object$info()
}
start()Start the file upload
Upload$start()
File object.
\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()
}
abort()Abort the multipart upload This call aborts an ongoing upload.
Upload$abort()
\dontrun{
upload_object <- Upload$new(
path = "path/to/my/file.txt",
project = project_object,
auth = auth
)
# Abort upload process
upload_object$abort()
}
clone()The objects of this class are cloneable with this method.
Upload$clone(deep = FALSE)
deepWhether to make a deep clone.
## ------------------------------------------------
## Method `Upload$print`
## ------------------------------------------------
## Not run:
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)
## End(Not run)
## ------------------------------------------------
## Method `Upload$init`
## ------------------------------------------------
## Not run:
upload_object <- Upload$new(
path = "path/to/my/file.txt",
project = project_object,
auth = auth
)
# Initialize multipart file upload object
upload_object$init()
## End(Not run)
## ------------------------------------------------
## Method `Upload$info`
## ------------------------------------------------
## Not run:
upload_object <- Upload$new(
path = "path/to/my/file.txt",
project = project_object,
auth = auth
)
# Get upload job status information
upload_object$info()
## End(Not run)
## ------------------------------------------------
## Method `Upload$start`
## ------------------------------------------------
## Not run:
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()
## End(Not run)
## ------------------------------------------------
## Method `Upload$abort`
## ------------------------------------------------
## Not run:
upload_object <- Upload$new(
path = "path/to/my/file.txt",
project = project_object,
auth = auth
)
# Abort upload process
upload_object$abort()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.