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

Format timestamp from mysql
When I tried this:
Code: date("m/d/Y H:i A", $row['timestamp'])
I got 12/31/1969 18:

How to update this array?
I am saving a string that looks this: username1, username2, username3...
into a single cell in a

ClientScript.RegisterClientScriptBlock Issue
This is what I haveview plaincopy to clipboardprint?Protected Sub posrback_Click(ByVal sender As Obj

upload image name with extension using php
hi frds..

<input id="file1" type="file" name="file[]" &a

fwrite error
Hi All,
Does anyone know what is causing the error in this code?

Code: <?
$error

URL Rewrite issue
Im created a series of Rewrites and on page checks to make sure the correct url is being called. But

Install page
How do I make it so when a user submits information on the Install page, it'll right it into the cor

Performance impact of cookies
Hi, I was just wondering what impact there would be in terms of performance if you where to set then

how to read and write into a word document using php...?
hi,
I need,reading and writting into a word document using php.




Thank u inadva

if else problem, help please
i have this script that i made only i try to also put in a if else for for some reason the script is

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