Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 19th, 2005, 11:45 PM
Registered User
Join Date: Mar 2004
Location: Ikeja, Lagos, Nigeria.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to keph
Default Renaming File During Upload

Please do anyone know how I can rename a file while uploading it?
This is my senario:
I upload form content into a database along with the file name of a picture file. Note, I store only the file name of the picture file in the database, the actuall file is stored in a folder on the server. This works perfectly.
However if two users have their picture files named the same way (e.g my_picture.jpg) only the first guy can upload. The second guy will have to change his file name or may actually end up deleting the first guys picture.
Is there a way I can dynamically rename pictures during the upload irrespective of what the user might have called his file?
Thanks all

Reply With Quote
  #2 (permalink)  
Old October 4th, 2005, 02:46 PM
Friend of Wrox
Join Date: Mar 2004
Location: Bhopal, MP, India.
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anshul

I think using rename("/tmp/tmp_file.txt", "/~path/file.txt");

Or see also move_uploaded_file()

Support Indian students' finances http://scholarship.mediasworks.com/
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Renaming long file name with VBA JillB Excel VBA 1 March 24th, 2008 06:20 PM
Renaming File ayazhoda Access VBA 3 April 24th, 2007 05:43 AM
subject: renaming a file w/ wildcards in name dgr7 Beginning VB 6 2 February 2nd, 2007 03:21 PM
Renaming remote mdb file elansolutionsltd Access VBA 7 November 11th, 2005 07:00 AM
Renaming a file during upload keph Pro PHP 1 October 6th, 2005 07:14 PM

All times are GMT -4. The time now is 01:40 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.