Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 19th, 2005, 11:45 PM
Registered User
 
Join Date: Mar 2004
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

http://www.kephassolutions.com
 
Old October 4th, 2005, 02:46 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anshul
Default


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/





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





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