I'm trying to configure Drupal to upload large videos (eventually goal is ~300mb, but currently testing with ~50mb files) to S3 through my Drupal site running on an EC2 instance.

I have configured and tried both the Amazon S3 and Storage API modules. When trying to upload a small file around 5mb, everything is fine and works perfectly. However, when I try with a large file, I receive the following error:

Warning: filesize(): stat failed for storage-field-storage-test://[FILE NAME].mp4 in file_save() (line 601 of /var/www/includes/file.inc).

This error is the same for both the Amazon S3 and Storage API modules.

It turns out that the large videos are not being uploaded to S3, which explains the error message.

I am able to upload files directly to S3 okay and I am able to upload large files to local storage just fine as well (the PHP upload limit is set well above what I'm trying). What I don't understand is what could be causing the failure with the large file sizes between Drupal and S3. Any suggestions?

  • 1
    You need to increase post_max_size, upload_max_filesize and memory_limit (or what these parameters are called in your hosting). Set them all to 100MB or so. When you do, it will become a Drupal question. unless you can't, and they have to stay below 50MB - then tell us what they are and that you are looking for workaround. – Mołot Jan 14 '14 at 8:37
  • 1
    @Mołot Thanks, that led me in the right direction. The upload_max_filesize argument wasn't specified in my php.ini. It's curious that I was able to upload large files directly the EC2 instance, but transferring them to S3 failed. – shanet Jan 14 '14 at 15:06
  • 1
    Sometimes scripts may modify these from within scripts... certainly receiving end developed by Amazon was able to do that on Amazon ;) – Mołot Jan 14 '14 at 15:08

As pointed out in the comments, this ended up being a PHP config issue.

While I had set the post_max_size and memory_limit arguments to 1GB, the upload_max_filesize was not set at all. Setting this to 1GB in the php.ini file as well resolved the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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