timmyd Posted December 4, 2007 Share Posted December 4, 2007 HI i have a problem, i want to upload a file in a different format and at the same time create a thumbnail. Everything is working so far except when i upload a .GIF file. If i upload a .gif file it will be uploaded as .jpg which is good. but the extension remains .gif. How can i rename the extention for this: <? if(move_uploaded_file($_FILES[$form_field]['tmp_name'][$p], $store_pad.$file)) ?> cheerz Quote Link to comment Share on other sites More sharing options...
adam291086 Posted December 4, 2007 Share Posted December 4, 2007 ok i am not a guru at this but couldn't you just explode from the . that seperates the file names and file type. Then just replace the .gif with .jpeg $file //variable for the uploaded file $type = explode(".", $file); echo $type[0]; // name echo $type[1]; // file type There maybe a better way to do this but this could be an idea 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.