Search code examples
pythonamazon-s3boto3

Different Between download_file and download_fileobj in boto3?


i want to download files which are in amazon s3. And i have used boto3 sdk and i want to know the different between download_file and download_fileobj in boto3?


Solution

  • From the documentation, it is mentioned that:

    download_file(Bucket, Key, Filename, ExtraArgs=None, Callback=None, Config=None)

    Download an S3 object to a file.

    and

    download_fileobj(Bucket, Key, Fileobj, ExtraArgs=None, Callback=None, Config=None)

    Download an object from S3 to a file-like object. The file-like object must be in binary mode. This is a managed transfer which will perform a multipart download in multiple threads if necessary.

    One is file, the other one is file-like object with binary mode.