jwk811 Posted April 30, 2010 Share Posted April 30, 2010 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? Quote Link to comment Share on other sites More sharing options...
947740 Posted April 30, 2010 Share Posted April 30, 2010 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. Quote Link to comment Share on other sites More sharing options...
litebearer Posted April 30, 2010 Share Posted April 30, 2010 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 Quote Link to comment Share on other sites More sharing options...
947740 Posted April 30, 2010 Share Posted April 30, 2010 Ah, that is a much better way to put it. Technically as soon as you hit the submit button it uploads, it's just a matter of where it's uploaded. I failed to distinguish that. Quote Link to comment Share on other sites More sharing options...
jwk811 Posted April 30, 2010 Author Share Posted April 30, 2010 i meant upload as in use move_uploaded_file() function to be in folder. otherwise its uploaded into a temp folder? Quote Link to comment Share on other sites More sharing options...
947740 Posted April 30, 2010 Share Posted April 30, 2010 Yes it is automatically uploaded to a folder on the server as a temp file. (I worded it incorrectly before...I believe it is always the same folder.) Once the script that is called by `action` in the form is done running, the file is deleted. Quote Link to comment Share on other sites More sharing options...
jwk811 Posted April 30, 2010 Author Share Posted April 30, 2010 so instead of moving the file to a directory of mine. i can just change it from the temp folder. how would i get to that instead? Quote Link to comment Share on other sites More sharing options...
litebearer Posted April 30, 2010 Share Posted April 30, 2010 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:) ] Quote Link to comment Share on other sites More sharing options...
jwk811 Posted May 1, 2010 Author Share Posted May 1, 2010 yeah i know but when i resize it i dont move it until after i resize it. how do i get to the temp image tho? Quote Link to comment Share on other sites More sharing options...
947740 Posted May 1, 2010 Share Posted May 1, 2010 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? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.