Jump to content

[SOLVED] File name change on upload


NerdConcepts

Recommended Posts

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.... :(

Link to comment
https://forums.phpfreaks.com/topic/41911-solved-file-name-change-on-upload/
Share on other sites

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.