upload#
- Mechanical.upload(file_name, file_location_destination=None, chunk_size=1048576, progress_bar=True)#
Upload a file to the Mechanical instance.
- Parameters:
- file_name
str
Local file to upload. Only the file name is needed if the file is relative to the current working directory. Otherwise, the full path is needed.
- file_location_destination
str
,optional
File location on the Mechanical server to upload the file to. The default is
None
, in which case the project directory is used.- chunk_size
int
,optional
Chunk size in bytes. The default is
1048576
.- progress_barbool,
optional
Whether to show a progress bar using
tqdm
. The default isTrue
. A progress bar is helpful for viewing upload progress.
- file_name
- Returns:
str
Base name of the uploaded file.
Examples
Upload the
hsec.x_t
file with the progress bar not shown.>>> mechanical.upload('hsec.x_t', progress_bar=False)