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

Help with file_get_html
The following code gives the expected results:

<html>
<head&g

How to read CSS message data
Hi,
I have a requirement here. When working as a Dev angel for multiple customers its really di

PHP friend keyword equivalent
is there a PHP equivalent for the C++ friend keyword?

bind error during socket programming
i am kinda new to socket programming. wrote the below code for a server. but getting the bind error

Grabbing Values From an Array for Posting
I have a grid array that I am using with a form that when it hits the currently named test.php it lo

getting rid of quotes in strings
sick of trying to deal with them in multiple ways (entering in and taking from database, echoing, ec

downloading a file as HTML
Hi.
I'm rather confused with forcing a download. I just want to save dynamic content (from $_SESS

PHP/Database issue
My friend is helping me make a database where you go to a certain webpage of my site and the page wi

Problem Dereferencing
With these types and tables:

CREATE TYPE MANAGER AS OBJECT (
MGR_ID INTEGER,

Track downloads' status
Hello,

I need to make somehow, some system, to track whether downloads are completed or faile

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