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

Parse Error with doctype
I'm getting a parse error with this simple code. I don't get it. It worked one time then when I relo

Batch Related Pricing
Hi, I need some clarity on the batch related pricing

For example the following are the b

update the selected existing records of database
Hi frndz,
I am new to php and get stuck....

Edit.php > Update.php > Updatea

big pagination problem in php
<?php

$connect = mysql_connect("localhost", "root", "")

mail() says sent but no email received
My code is quite simple:

Code: <?php
$to = "Ty44ler@yahoo.com";
$subje

Using two $_POST Function / Switch () statements, second does not work.
Hi all. I’m new to php and am having a problem getting $_POST Function / switch () to work. I

array_count_values question?
ok i'm trying to create a top ten list from a database of listed favorite movies.

the followi

storing results of a function - previous result overwritten with new result
I have created a function to validate input.

function validate_dimension($value,$name) {
<

Firefox displaying PHP source code??
Currently testing a site thats almost built, am going to be including php on a sidebar on all pages

list files from folder, only one for each date
I have many files in a folder and wish to only list one of each date

these are the file names

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