I've got a script that allows a signed in user to browse their computer and upload an image. The script then resizes the uploaded image, once for the correct display size and secondly for a thumbnail.
It all works fine but.....only for smallish images
By trial and error any image bigger than 200k tends to break the entire script and I get an ugly error page.
I tried fixing it by adding a size filter:
//check size
if ($_FILES["file"]["size"] > 200000){
header("Location: http://www.myDomain.com/tooBigError.php");
exit();
}
That kind of works (sometimes even a 194k file trips the filter) but 200k is ridiculously low, especially when the users I'm targetting are likely to be taking their pictures with hi-res digital cameras. Also anything way bigger than 200 completely breaks the script and I get an error again! Sometimes I get a php memory error too.
I've tried all sorts of things but short of directing the users to an image resize site (an ugly solution) I'm out of ideas. Ideally I'd like to be able to upload images of 3Mb.
I'm on a decent but shared hosting package, just wondering how Flickr and other sites easily upload large images with no problems?
Anybody know? All ideas welcome!