garydt Posted July 22, 2007 Share Posted July 22, 2007 I've got- $uploadsDirectory = './uploads/'; //Upload image $uploadFilename = $uploadsDirectory.$a.$fieldname['name']; $a is a random generated number. Then the script calls a function to resize the image and saves it in the smallpics folder - if(imagejpeg($thumb, "smallpics/".$a.$name, 80)) { //image-resource, filename, quality return 1; } But it doesn't keep the generated number, it just saves it as the orignal file name. Why is this? Shall i post the full function script? Quote Link to comment Share on other sites More sharing options...
garydt Posted July 22, 2007 Author Share Posted July 22, 2007 Can anyone help? Quote Link to comment Share on other sites More sharing options...
garydt Posted July 23, 2007 Author Share Posted July 23, 2007 I'm still having difficulties Quote Link to comment Share on other sites More sharing options...
garydt Posted July 23, 2007 Author Share Posted July 23, 2007 can anyone help please? Quote Link to comment Share on other sites More sharing options...
stlewis Posted July 24, 2007 Share Posted July 24, 2007 Why is it that you go to the trouble of creating a variable to hold your new file name, "$uploadFilename" but your IF statement tests (..smallpics/".$a.$name..) Shouldn't it be: if(imagejpeg($thumb, "$uploadFilename, 80)) { //image-resource, filename, quality return 1; } That might help a bit, sorry if it doesn't! 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.