One of the key upgrades to the PhotoGallery System is improving the way photos can be added. At the moment, the system is pretty basic and simply uploads the files individually using <input type="file"> input boxes.
There are various systems out there on commercial sites. Some of these include complex plug-ins that allow drag-and-drop, FTP utilities, and applets. These are all somewhat of a nuisance and require the user to download various bits and pieces to get them working. For a solution, I wanted something that would allow for multiple file uploads, be easy to use, and take a minimum amount of time to develop.
The quick and easy solution that I’m strongly leaning toward is actually incredibly simple. PHP has an excellent set of ZIP File functions. I quickly tested them last weekend and it’s as simple as compiling PHP with zip support, and using the little snippet of demo code on the PHP site. All the user will have to do is take all of the photos they want to upload, place them in a zip file, and upload the zip file to the website. Server-side, the photos are extracted from the zip file, processed, and a wizard allows the user to enter photo information. While not every end user knows how to zip a file, most do, and it’s relatively easy to learn. The only other concern is for Apple or Unix users, though there are functions out there for .sit and .tar files that I could incorporate later.
Has anyone else come up with a bulk-file uploading system, or have alternative ideas or suggestions?
view zip extraction demo
Code Sample
Zip File
259Kb
Comments
Joao Prado Maia - June 19, 2003 6:09 pm
Please don't rely on requiring your users to use a ZIP-type utility in order to be able to upload multiple files, dynamically.
I already have a system working for allowing multiple dynamic file uploads with some simple DHTML, and PHP's ability to automatically create arrays for input fields named 'some_name[]'.
Is this little tip good enough for you to get started ?
--Joao
Joao Prado Maia - June 19, 2003 6:47 pm
Ah, indeed. On that case zipping the files is not such a bad thing, but for a normal scenario where the user needs to upload 3 or 4 files, it's not such a problem.
But no, my solution doesn't allow the user to select more than one file at a time. It would be nice if XForms (or the next generation of it) would provide this functionality.
Oh well :)
--Joao
Daniel Von Fange - June 19, 2003 9:07 pm
Seems like a great solution to the problem. Definitely so competent computer users. Good thinking.
Peter Rukavina - June 21, 2003 4:54 pm
<P>
Apple's Mac OS X has a zip utility built into it. Usage:
<PRE>zip filename.zip file1...filen
</PRE>
For example:
<PRE>zip petephotos.zip dog.jpg cat.jpg
</PRE>
It's command line driven, of course, so not as easy as it could me.<P>
To solve this problem for posting to my own website, I wrote a brief AppleScript (OS X's secret weapon) that lets me drag and drop photos on an icon on my desktop, and then copies them to my webserver, resizes them if necessary, and copies HTML required to include them into a weblog post onto my clipboard, from where I can simply paste it as appropriate.
Peter Rukavina - June 21, 2003 5:09 pm
Thought: modern email clients make emailing photos an easy drag-and-drop operation. Grandmothers know how to do this because it's how they send photos of grandchildren to each other. So, users up at the website, register an email address, and then simply add photos to their "library" by emailing them to a purpose-built email address that accepts photos and processes them.
Jevon - June 22, 2003 12:52 am
What would be considered an "average" attachment size limit? I recall that being an obstacle for several similar attempts of mine (caveat: not photos) in the past at solving similar problems.
Adam Kalsey - June 22, 2003 3:19 pm
A solution I once used on a private extranet for mass file uploading was to open an FTP url in an iframe through the browser. The user then simply drags all their files into the iframe. They can even navigate through the FTP directory structure first if they would like.
The disadvantages of this approach:
You have to embed the FTP username and password in the FTP link.
It depends on browser support, but most modern browsers now support drag and drop FTP uploads.
Nick Burka - June 23, 2003 10:08 am
Peter and Adam, good ideas both.
Peter, I'd already been considering doing the email attachment root. There were a couple reasons I prefered the ZIP file, but I might rethink that; the common knowledge of how to email is definetly attractive. That said, issues with associating email adresses with certain sites, and limits for sending attachments (Hotmail limits this to about 1Mb, receiving of course is not a problem) might cause a few problems.
Adam, I'm going to try out this iframe-FTP idea. I wonder what the browser support is.
Keir - June 30, 2003 5:31 pm
Has anyone tried out Adams suggestion of using an iframe to hold the FTP window? It is perfect for one of my current projects but for some reason the first screen loads fine and contains the FTP window within the iframe but any subsequent drilling down looses the wrapper HTML and launches the FTP window into full screen view.
Has anyone else had this problem?
Kyle Parker - August 31, 2003 5:49 pm
A new tool that we developed can do this. Look at http://www.ibulc.com for more info.
Jevon - September 4, 2003 4:06 pm
Here is a creative, if not risky, approach to solving this problem.
Anal_Towel - June 29, 2004 5:29 pm
hi Keir, i have this problem too.. I try with target="internal" in iframe tag, but doesn't work.. ahhgg.. ill be crazy if i continue thinkin about it..
Jim Amos - June 30, 2004 8:57 am
I'm interested to see how this progresses. I've been searching for a decent gallery upload/management tool for ages. Did you solve the problem of multiple uploads yet? Also, what is the status of the system with regards to the intended 'XHTML Strict and CSS Level2 standards compliance'? It's a real shame none of this is being made public, there is a real need for this kind of solution. Though I understand your financial reasons for keeping it locked. Just as a developer this sounds like a very good thing.
rohini - April 27, 2006 9:14 am
I need "FTP bulk upload tool" in php, can anybody post me the details its very urgent.
Martin - May 3, 2006 5:59 am
Hi All,
My problem is exactly the oposite. At a party I took sevoral photos. Now I want to make them available on my website for download. My first idea was to let the visitor select the photos he want to have (stored in a database), have PHP zip them and finaly have PHP mail the zip-file to the visitor.
Anyone know how to do this?
Thanx in advance
Martin