download_file#
- ProjectApi.download_file(file, target_path, progress_handler=None, file_name=None, **kwargs)#
Download file content and save it to disk.
- Return type:
- Parameters:
- file
File File object to download.
- target_path
str Path to the directory where to save the file.
- progress_handler
Callable[[int],None],optional Function to handle progress updates. The default is None. The function should accept a single argument, which is the current size of the downloaded file in bytes.
- file_name
str,optional Name of the file to save. If None, the original file name is used.
- kwargs
dict,optional Additional arguments to pass to the download function. The ‘stream’ argument is deprecated and should not be used.
- file
- Returns:
strPath to the downloaded file.