Forum Moderators: coopster
With 5MP+ cameras out there many people have pictures that are over 2MB straight off the camera. As a convenience to the user, I would like to let them upload the pictures immediately after they pull them from the camera. I have the pictures resized to around 50k once they are on the server to conserve space and bandwidth.
Unfortunately, I can't even get the files over 2MB onto the server. As you know, many people are clueless about resizing their pictures and won't go to the trouble. I want them to be able to use my site. Does anyone have any good tricks to move 2MB+ files?
If it doesn't exist, make a new text file named
.htaccess and place it in the directory your upload script is in. The
.htaccess file should contain: php_value upload_max_filesize xM where
x is the maximum size you want to allow, in megabytes. (i.e. 5M for 5MB). The reason this variation from the .ini file is not placed in the script itself is that the .ini instructions have already been initialized by the time the script is opened, and the
[url=http://us2.php.net/manual/en/ini.core.php#ini.upload-max-filesize]upload_max_filesize[/url] instruction would be ignored. Placing the instruction in the .htaccess file causes it to replace the .ini instruction *before* the script is parsed. You may want to check that you are not violating your hosting company's TOS before making this kind of change.
I don't know what to do with other server brands ... never used 'em ...
Now my only problem is it still takes forever(2+ minutes) for those 2MB+ pics to load. I guess the only way to fix that is to have the users resize their pictures before they attempt to upload them. I limit it to 10 pictures at a time but if someone tries to upload 10 2.5MB pics, they may be waiting 30 minutes for it to happen.
I don't guess there is any type of clientside script that can resize the pictures before they are uploaded. If there are I'd be interested though.
Tom