NYCPHP Meetup

NYPHP.org

[nycphp-talk] A Form That Builds Itself

David Krings ramons at gmx.net
Wed Jun 6 21:04:16 EDT 2007


CED wrote:
> yeah, that too. Anything referencing the div.
> 
> I'm just ajax happy, go XOAD!... Ignore me.
> 

Or if you don't know how to get around with AJAX or such, have the users 
upload the image files as a zip archive. Depenging on which images you 
want to allow, adding a few .bmp files may quickly fill up the submit 
buffer of the server and / or PHP.
I finished just last week such an uploader and I must say, I am still 
impressed on how quickly I could jam 800 images into the system (in 
chunks of 100 due to server upload limits). In all fairness, I did this 
while being local to the server, but anything else would be upload time 
which depends on client-server connection. I did add a URL load option 
as well, so that one could upload the archive first via FTP to the web 
server and then have the server download it from itself or a different 
FTP or web server assuming the connection between the two servers is 
significantly faster than from the client to the target server. I also 
made it so that users can have the image files in any amount of subfolders.

Or you could do that with PHP and by using a script that calls itself. 
But I really don't recommend this as this requires not only an entire 
page reload each time, but mandates the full submission of the form each 
round - with the already specified image files. This is the dumb stuff I 
did three years ago when starting with PHP. Don't do it, that approach 
sucks. Besides that, since HTML has such a crappy file upload control 
you will get into other trouble for sure.


I couldn't have done my 'turboloader' without the help from the great 
NYPHP folks. So, any way you go, you will find help here.

David



More information about the talk mailing list
Automatic Email Organization without missing anything!