beermaker74 Posted January 28, 2007 Share Posted January 28, 2007 is there a way to resize the image before it is uploaded to the server. If it is not possible with php, is it possible with javascript? Link to comment https://forums.phpfreaks.com/topic/36007-image-resize-on-the-client-machine/ Share on other sites More sharing options...
AndyB Posted January 28, 2007 Share Posted January 28, 2007 Not that I've seen. But upload, resize, move and save will work just fine server-side. Link to comment https://forums.phpfreaks.com/topic/36007-image-resize-on-the-client-machine/#findComment-170807 Share on other sites More sharing options...
Hypnos Posted January 28, 2007 Share Posted January 28, 2007 It's possible with HTML. Just force a size in the img tag. Instant image resize.EDIT: Re-read your question. Even if there was a way with Javascript, it probably wouldn't look very good, and it would be a large amount of code.With PHP you can take the temp file that was uploaded, AFTER it's on the server, and resize it. But there's no way with PHP to make modifictions to a file PHP hasn't seen yet. Link to comment https://forums.phpfreaks.com/topic/36007-image-resize-on-the-client-machine/#findComment-170812 Share on other sites More sharing options...
beermaker74 Posted January 28, 2007 Author Share Posted January 28, 2007 if I had a real popular site, wouldnt that really eat into my bandwith. It would be nice to have an app that can resize a folder on the clients machine then upload. I have seen some ajax stuff that kind of does that. If it wont affect bandwith much then I guess I will go with the php method. thanks Link to comment https://forums.phpfreaks.com/topic/36007-image-resize-on-the-client-machine/#findComment-170814 Share on other sites More sharing options...
Hypnos Posted January 28, 2007 Share Posted January 28, 2007 [quote author=beermaker74 link=topic=124354.msg515067#msg515067 date=1169944138]if I had a real popular site, wouldnt that really eat into my bandwith.[/quote]It will add to it, but not as much as people viewing the images.Set this in your upload form:<input type="hidden" name ="MAX_FILE_SIZE" value="2000000">If your site bandwidth limit can't take 2mb file uploads, then you probably shouldn't be doing user images. Link to comment https://forums.phpfreaks.com/topic/36007-image-resize-on-the-client-machine/#findComment-170824 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.