Jump to content

Renaming file while uploading


Mudsaf
 Share

Recommended Posts

You can use the rename() function to rename a file. As for adding to a file name, don't think your example would work. This is probably the proper way: $_FILES['file']['name'] . 1935; but this is what it's going to look like: mypicture.jpg1935 for example.

Link to comment
Share on other sites

Hello, im wondering how to re-name or add example 1064 after the uploaded_filename. Does it work like $_FILES['file']['name' + 1935]?
This won't work. $_FILES is an array, and so are it's members, like 'file'. Even with the . syntax, you would basically be looking up this
$_FILES['file']['name1935']

as an actual member. So best to just rename the file using actual native filesystem functions like Don E. showed you.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...