2

I'm setting up a form where people will be able to submit photos for a contest. It uses Safecracker and the Safecracker file field to upload a single photo and related metadata with the photo going to a designated directory.

Works fine with smaller images, but chokes once it gets to about 4mb file size. Looks like it's running into the max CPU runtime. I imagine this problem will get worse as the # of entries in that directory increase.

I've been looking into addons for using Amazon S3, but it looks like these are more for file management from within the Control Panel, or integrated with edit forms...and that they leave copies of the images on the site's server. Is there a way to use Safecracker to upload directly to Amazon S3 so I just bypass this problem with the server choking?

Also, I'm trying to figure out the best way to make sure each title/photo has a unique name, and thought the cleanest way would be to append the entryID to each upon submission. Wondered if anyone had another solution. Duplicate photo names right now are getting the word "temp" added automatically, but that looks clunky.

Thanks!

1 Answer 1

3

You want Simple S3 Uploader - this will upload directly to S3. I'm using it on a site at this very moment and I'm uploading 6-12Mb Images and it's absolutely fine.

3
  • Excellent. Thank you, I will download and give it a try.
    – Paula
    Commented Jan 11, 2013 at 17:46
  • Have tested this out and the script still chokes with files 3-4 mb and up. . Fatal error: Out of memory (allocated 57147392) (tried to allocate 19712 bytes) in /.../expressionengine/third_party/simple_s3_uploader/ft.simple_s3_uploader.php on line 840 Am on a shared server with a 64MB memory limit.
    – Paula
    Commented Jan 15, 2013 at 2:37
  • There's no way you'll be able to upload larger files with a 64Mb memory limit on shared hosting. You'll need to consider upgrading and setting at least 128-256M. Allow check what the upload limit and the script execution times are set to as they may have a deciding factor. Commented Jan 15, 2013 at 10:27

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.