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

. and .. appearing instead of pictures
First of all, thanks very much for providing this forum. It is very much appreciated!

My son

question about n
I was looking at some of the things you could do with php and one of the things I have tried is n.<

Writing to the middle of a file
Hi I have a bit of a problem. Is there any way i can write some text to a middle of a text file. For

Form validation with functions
Hi there

I am trying to make a very simple form validation function. I currently have the fol

Help uploading .JPG
I have a problem with upload images when the ending is .JPG capitalized.. I really don't know what c

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

Dump with added_funcion cl_salv_table
Hi there, I'm having some troubles adding a self defined function to an ALV in fullscreen. The thing

Is there a way to override built in php functions without APD?
I am trying to use the
rename_function()
override_function()
options that are built into

Interpret Order
Hello all,

I'm wondering if I have this:

Code: $switch = array(
'one' =>

ALV List display - header width adjust
Hi,

I am using REUSE_ALV_LIST_DISPLAY for my ALV display.The width of the ALV varies for

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