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

Multidimensional Array into an Html table, help!
Hello all, I am new to HTML/PHP so any help would be great.

I have a multidimensional array f

Can we convert non uni code system into unicode
Hi All,

Presently i am using non-unicode system and the sap version is 4.7.
Can i c

Hit counter updating once per IP - IP HIT COUNTER
I have a hit counter, for the amount of views on a tutorial.
It'll do the query and then do..

Redirecting Admin
In my members table, I have a field called "perm" and it's set to zero for all members. Ho

Please Help my PHP Dating Function.
Hi everyone!

Well here is my code that displays this:

It works wonderful.


rand() function
just a general question guys a girls, is the rand() function 100% random or is it based on time?

Coding Critique
I was hoping someone could take a second and look down my code and see if they see any problems with

Help Optimizing code
Good Morning,

I wrote a small import function for a website of mine and I know there has to b

OOP help
okay so i have a class im making it has everything setup i just need to randomize the 2 variables an

Place specific image in html page when specific name is typed.
Hello,

Fairly new to PHP and was curious if someone might know how to solve a fairly simple r

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