inveniosoftware / invenio-s3

S3 file storage support for Invenio.
https://invenio-s3.readthedocs.io
MIT License
0 stars 16 forks source link

File upload fails for big files #11

Closed egabancho closed 4 years ago

egabancho commented 4 years ago

When uploading big files the number of total parts gets bigger than the maximum (1000) and makes the upload fail. This happens probably because s3fs doesn't use the file size to calculate the chunk size and it rather uses the default value (5Mb) if no other value is provided.

Maybe we can assume that the file size is passed as a parameter (somehow making it mandatory) and when instantiating the s3fs object pass the chunk size, default_block_size, which should be the max of 5Mb and file_size/1000 (5Mb is the smallest we can go). This works on my head, but I haven't tried it yet, and there might be some issues ☺️

Other alternatives are welcome.