2

I am having an issue with Assets when trying to upload large-ish .mp3 files to an Amazon S3 bucket.

Here is my setup:

  • ExpressionEngine v2.5.5
  • Assets v2.1.2
  • PHP v5.4.10 (via MAMP)
  • Dedicated Amazon bucket (tested with smaller image files and is confirmed to be working and accepting uploads)

I have adjusted my php.ini settings to the following values:

  • post_max_size = 500M
  • upload_max_filesize = 500M
  • max_execution_time = 600
  • max_input_time = 600
  • memory_limit = 128M

While trying to upload a .mp3 file that is 120MB in size (it's a podcast), I get the following error in Assets:

Could not upload the file - server returned an unexpected response. Please check the server settings.

Checking the PHP error log, this is the message I see:

[05-May-2013 14:19:33 America/New_York] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 80987568 bytes) in Unknown on line 0

That's a lot of memory Assets is trying to use. I'm not sure how Assets deals with big files – does it try to load the entire contents in memory and then upload? Any other settings I could try?

A quick note – I did try uploading a 15MB .mp3 and that worked without problem.

  • 1
    Hey Chad - I've asked one of our engineers to look at this as such a large file will take some resources - I'm just not sure if what you're seeing is unexpectedly excessive. I'll also try to locate a large MP3 of that sort and do some testing myself. Thank you! – Lisa May 6 '13 at 17:55
  • Hi Lisa – any chance the engineers have had a chance to look into this? – Chad Clark May 10 '13 at 17:01
  • 1
    Hi Chad, my fault for not following up sooner, my apologies. It looks like PHP may be dying before it reaches Assets. We may explore better ways of uploading for a future version of Assets; but for right now the immediate solution is to increase your memory to handle the larger sized uploads. – Lisa May 10 '13 at 17:58
  • Hi Lisa. Okay, that is good to know. I'll try some different values and let you know what I find. Thanks! – Chad Clark May 11 '13 at 18:39
1

You may want to attempt to use CORS -- http://aws.typepad.com/aws/2012/08/amazon-s3-cross-origin-resource-sharing.html

This will upload from the end user right to S3 -- it will perform faster.

Example code here: http://www.ioncannon.net/programming/1539/

| improve this answer | |
  • CORS looks very interesting. This is something to look at in the future, but I am hoping there is a solution in place for Assets in lieu of writing a custom add-on. – Chad Clark May 6 '13 at 13:55

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.