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.

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

how to hide input fields on selection screen using variant attribute
Hello all,

I want to know how to hide input fields on selection screen using variant attr

DATEDIFF Question
First time post, and of course it is a help question.

I am using a WP plug-in to display prev

Sort Alternative/bi-monthly
Hi all,

Am going mad trying to get something to work.

I'm creating a CMS for a magazi

What am I missing here? Help!
Hello all!. I can't seem to get this working right. Well - it renders right, but something is goin

Image loading
Hi Developers,

I'm trying to display an image from images/image.gif getting the url from mysq

Problems with returning true or false in eval()'d code
Hi guys,

Would appreciate some help with a problem when running eval() on a function that sho

Will an XHTML DOCTYPE interfere with my PHP if I'm not experienced enough?
I've read this article here: http://friendlybit.com/html/why-xhtml-is-a-bad-idea/

In a nutshe

HeaderSelectedCssClass not working
I have an accordian where I have a drop down list in the first pane and a grid in the second pane.

Got A Free Server :(
So I was given a free server

http://shopping.yahoo.com/p:Compaq%20ProLiant%201500%20Server:1

php mailer
How can i send a mail to large no, say 50,000 reciepients using [color=#0000FF]php mailer[/color]

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