NerdConcepts Posted March 9, 2007 Share Posted March 9, 2007 I did find some old posts on doing this, but they don't clear up my issue really. I am using the move_uploaded_file function... actual code: if (move_uploaded_file($_FILES['image']['tmp_name'], "../uploads/{$_FILES['image']['name']}")) { ... Well my question is, how in the heck can I randomly generate, say 5 characters long, random name for the image that is being uploaded. There will be a large number of image I am going to have to deal with so I am storing the file name within mysql under whatever business has uploaded it. So finding it, isn't the problem. The problem is that multiple companies uploading images with the same name...most problem is with 'logo.jpg/gif'. Hmmm, I guess I am just bursting from code out of my ears since this should be something simple, yet for some reason I can't get it to work. BTW, hopefully by April I'll be able to show everyone what they have helping me finish up. But right now it's under lock and key.... Quote Link to comment https://forums.phpfreaks.com/topic/41911-solved-file-name-change-on-upload/ Share on other sites More sharing options...
benjaminbeazy Posted March 9, 2007 Share Posted March 9, 2007 this shows you how, find the extension and create a new file name with random name + ext http://www.reconn.us/content/view/30/51/ Quote Link to comment https://forums.phpfreaks.com/topic/41911-solved-file-name-change-on-upload/#findComment-203222 Share on other sites More sharing options...
NerdConcepts Posted March 9, 2007 Author Share Posted March 9, 2007 Thank you very much Quote Link to comment https://forums.phpfreaks.com/topic/41911-solved-file-name-change-on-upload/#findComment-203229 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.