Renaming a file that a user uploads to site?


Posted on 16th Feb 2014 07:03 pm by admin

My site allows for registered users to upload images to the site under their own gallery. Currently it just leaves the file named as however the person has it named. But what I would like to do is something another site does, which is rename the files when the user uploads them. An example of how I would like it done:
A user whose username is "I Like Cheese" uploads a file named "whatever.jpg", but in the uploading form, they title the upload "Dog In the Rain". I`d like like "whatever.jpg" to be renamed to "Dog In the Rain_by_I Like Cheese.jpg" upon the upload process and use that new filename for the database information.

Did you know?Explore Trending and Topic pages for more stories like this.
How would I tell the system to rename the image file in that manner?
No comments posted yet

Your Answer:

Login to answer
225 Like 41 Dislike
Previous forums Next forums
Other forums

send message to the java application
Oracle 10g with Windows platform.

I have a java application that periodically pings the d

Giving the below syntax error
Dear Experts,

I have used 2 buttons in gui status as display and cjhange.When the user wi

What exactly is net neatrality?
What exactly is it? I think it's anti-censorship and... stuff... but I don't really understand it

Sum of Values in an Array
This is probably really simple... but it's been years since I've written anything, so bare with me!<

Add code to enable passing of checkbox variable on login
Ok, I have a login page, but want to add a checkbox that when checked and successful login is made i

Random Number Generation And Probability
Hello, I am working on a function which has to insert data into a SQL table.

we have to suppl

Get keys and values from an array
Hellow,

I have an array $Data with keys and values. With a foreach I can display all the valu

Multiple forms on the same page (safari)
Hello everyone,

I have 3 forms on the same page, that opens in a new window and submits to a

PHP Script runs on CLI but not through web browser
I am running into an issue that I just can't seem to find the answer to. I have a Windows Server 200

Php mysql - select?
Hi i have this code:
Code: $iteminfo = mysql_query("SELECT desc FROM wc_items WHERE itemid =

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash