Architecture advice pls: DH and Amazon S3


I am developing a php script-driven website on DH. My goal is to allow authenticated website users to upload large media files to Amazon AWS S3, and enable those files to be streamed out to authenticated users from Amazon S3/Cloudfront.
I had planned to host my php upload scripts and streaming calls on DH like this: -(a)user logs in and authenticates on DH-hosted website/database, runs upload script on DH to upload large media files to S3. (b) user logs in and authenticates on DH, runs php script on DH to stream media files from S3/Cloudfront. Cloudfront serves the media file to the user.
I have tried using the Amazon S3 php API calls(both standard upload and multipart(chunking) scripts) to upload large files. However, the scripts fail if the file is >7MB. Useless for a large media file. I believe this is a DH issue rather than a problem with Amazon S3.

Your advice pls:
Is my architecture sound? Would life be easier(possibly more costly??) if I hosted the website on Amazon EC2 alongside the storage, streaming service and CDN?

I have no experience of server admin, htaccess, php.ini, etc, but am willing to learn if necessary. Is there a setting on DH which would allow upload of files larger than 7MB? Or does DH consciously throttle back on upload file size? What is the max file size DH would allow the scripts hosted on DH to upload to S3? Where should I start to look for server settings advice, if I opt to keep the website on DH? Does the DH Cloudfront (goodies) service have an API which would allow me to better integrate my php scripts with Amazon?

BTW, the media content is owned by me or my authenticated users, so no DH TOS problems(I think).

So many questions. Thx in advance,


If you plan on building an application like this, I’d strongly advise you to dig deeper into the S3 documentation. It’s actually not necessary to run either downloads or uploads through DreamHost. For downloads, S3 supports temporary access URLs using query string authorization. For uploads, you should check out their REST object POST API.

As far as PHP uploads go, that’s controlled by the PHP.ini max_upload_size setting. However, this won’t matter if you upload directly to S3. :slight_smile:

DreamHost’s Cloudfront functionality isn’t really meant for the type of application you’re envisioning. It’s primarily meant as a utility to simplify the process of making static site content (e.g, images) available through the Cloudfront CDN.


Got it working, albeit I have to do more work on the security. But the basic REST-based upload works for large files! You’re a star!! Thx for the advice. :slight_smile: