Results 1 to 2 of 2
Oct 14, 2010, 07:49 #1
- Join Date
- May 2004
- Central USA
- 0 Post(s)
- 0 Thread(s)
File Upload with Multiple Adapters
I am currently in the middle of writing a CMS for a client, and have come across the need for a file upload solution. I could do the standard hackey $_FILES handling and file writing to a directory, etc. but the process of thinking about it has left me wondering if there is an existing solution that can do more. I checked out Zend_File and it left me a little disappointed.
It's okay to write the files to disk at first, but when you scale out you need to put the files elsewhere - Amazon S3, a CDN, separate networked servers, etc. Is there any existing solution that can handle file uploads through the same interface and is able to support multiple backends (I realize this might mean having to store the uploaded file in a local "/tmp" directory first as an intermediate step)?Stackbox CMS - Full edit-on-page drag-and-drop CMS
Autoridge - Vehicle information & maintenance part numbers
Oct 14, 2010, 12:49 #2
Haven't come across any existing solutions that I liked.
What I like doing is getting a hash of the contents (eg sha1) and store that in the database.
All the backend component implementations deal with the sha1 key.
So a file contents with sha1 2fd4e1c67a2d28fced849ee1bb76e7391b93eb12
So the basic directory implementation would map it to /somedir/2f/d4/2fd4e1c67a2d28fced849ee1bb76e7391b93eb12 for example.