I have one file uploading form in Drupal 8 where I am uploading 3 different assets and they might be around 2gb or more in size.

I have the s3fs module enabled and configured properly, but (due to temporary storage) it is consuming lot of time to upload to web server. First it uploads in the "/tmp" directory and then to "s3". I have also tweaked apache settings to handle large file uploads.

Is there any way to speedup this upload process? If it's possible how to fetch the uploaded file properties for edit action on the same form?

2 Answers 2


The s3fs module page mentions the use case of uploading very large files directly to S3:

If your users need to upload very large files to your site, you might want to use the S3FS CORS Upload module. It enables CORS-based uploads, allowing files to be uploaded directly to S3, rather than being routed through your server.

The s3fs module alone only has a S3 client for PHP and will not do what you want. However it is still useful as the recommended module depends on it.

  • 1
    I have checked with the same already but still with CORS module file uploads in the "/tmp" directory first and then to "s3" which take same time with S3FS and via cloudfront, browser given me bad response as large file takes too much time to upload.. Commented Aug 20, 2019 at 10:20
  • @VaibhavGidde did you use an existing or standard file field rather than an 'S3fs Cors File' type? There's nothing in the docs telling you to do this, but the test is to look in the source of an add/edit node page and see if s3fs_cors.js is loaded. If you upload a large file, do you see the 'Uploading: x%' progress and the buttons greyed out? (Not 100% sure it's still not making unnecessary calls to Drupal, but large files are going via Amazon when my Nginx/Apache site says they're too big.) Commented Mar 21, 2020 at 18:57

A simple workaround will be to upload the file directly to S3 using AWS CLI.

Just in order to create the file in your Drupal database upload a small file with the same name which will later be overwritten by the file you are going to upload using AWS CLI.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.