Page 1 of 1

best and quick way to upload images using php

Posted: Thu Apr 26, 2007 7:38 am
by louie35
I have a form which allows users to upload images on the server.

At the moment it works perfect, including image resize from whatever the user uploads (image) to 1024x800 and creates thumbnail 100x75, renames file, adds a reandom number to the end to prevent overwritting others images, etc.

The problem i have is that most of my users does not know how to adjust the camera to take images not bigger then 1200 or 1024, they take the full quality over 2000 which makes the upload very slow and of course complains if they get an error.

I am stressed out looking into this to make it faster. i looked into Ajax giving them some visual effect that something is happening but they are not happy.
Is there a better way? Can not limit the size uploaded, because they are not good at handling basic program for resizing the image, so restriction is out of the picture.

Any ideeas? can it be done using cron job, or somehow in the background?

Posted: Fri Apr 27, 2007 1:00 am
by Christopher
PHP currently can't do a progress bar without patching. I understand that they have added the necessary capability to the latest versions of PHP. But for now you will probably want to use a solution that mixed PHP and another language. I know there is a Perl based one around somewhere. Just Google for something like "PHP upload progress meter".

Posted: Fri Apr 27, 2007 2:29 am
by louie35
I am trying a different way now.

Get the image uploaded, save it in a different folder, create a table in the database to hold the details i need later and run a cronjob every 15min.

I will see how that works.