Jump to content

upload before resizing image?


jwk811

Recommended Posts

i find it easier to use move_uploaded_file() and then resize the image that now exists in the folder than to get the temporary image and use the other functions that have been messing me up. my question is, is it going to take longer to upload and resize and delete original or is there a simple way to resize before uploading. if it should be okay how do i delete the image when im done?

Link to comment
https://forums.phpfreaks.com/topic/200290-upload-before-resizing-image/
Share on other sites

It is my understanding that you have to upload the file before you can manipulate it.  Perhaps, though, you could manipulate the temp file stored on the server (I don't know if this is possible-just a though)...but if you're still manipulating a file on the server, I don't know if it would truly make a difference to do it before or after uploading.

being server-side, php manipulates AFTER the image hits the server. There are scripts that will resize at the time the file is first uploaded before it is saved.  And ones that will resize after you have saved it. I doubt that the time differential will be significant.

 

To resize BEFORE it is uploaded would require javascript

You wouldn't LEAVE it in the temp folder. As part of your upload script, you resize, if you want, then move to a permanent folder. Its really very painless [Well my doc said that when he told me they were removing the kidney stone:) ]

 

 

The temp file information can be found in the $_FILES array.

 

I am really having trouble understanding, though, why you HAVE to resize the temp image before moving it to a different place on the server.  Common convention is to upload (i.e. move it from the temp folder) and then manipulate the image...why not go with common convention?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.