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

Clean URLs
Hi I was wandering if anyone has ever implemented URLs on their PHP run website using URLS like wiki

Database 'Validation'
Hi everyone,
I'm trying to validate the password entered by the user with the password in the dat

gettext translates ALWAYS?
I'm using gettext with the new version of XAMPP (5.3.0) on Windows Seven RTM (build 7600)
gettext

Comparing two dates
Hi Guys
I have two dates I want to compare. Below is my current implementation. The problem with

reating a background image
I am building a site in drupal and have a php form in it, due to certain annoyances with module buil

need help with this contact form
I made this form and I need it to read the data and write the data to a table and its not working ca

Not reloading page after php form submit
Hello helpful souls out there. You guys have come through for me in the recent past and I'm hoping s

Else statement screws up all css
Does anyone know what goes wrong in the process with this php code?
This code seems to be causing

Is STL important?
I'm just starting programming and I've made it until the Standart Template Library. But the chapter

RSS poster script?
I have found a script that posts RSS's for me on a site that I'm building. However I would like to a

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