Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.