Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
php image upload overwrite?
Old 10-08-2008, 10:56 PM php image upload overwrite?
Novice Talker

Posts: 6
Trades: 0
how can i let image overwriting when uploading? and if uploading an image titeld different how can i make it to change to specific file tite?

im trying to make an image replacement to change images on the web page like for example logo
Darkwoods is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-09-2008, 12:55 AM Re: php image upload overwrite?
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
Ermm... What is the problem? If you move_uploaded_file() to the same location every time, obviously it will be overwritten.
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Old 10-09-2008, 03:58 AM Re: php image upload overwrite?
Novice Talker

Posts: 6
Trades: 0
Quote:
Originally Posted by mtishetsky View Post
Ermm... What is the problem? If you move_uploaded_file() to the same location every time, obviously it will be overwritten.
yep but how can i make the file name change to the one i already uploaded lets say i have logo.png and i uploaded logo444.png how can i force it to rename to logo.png?
Darkwoods is offline
Reply With Quote
View Public Profile
 
Old 10-09-2008, 04:15 AM Re: php image upload overwrite?
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
OMG

Did you read the manual? I am sure you did not. RTFM the "Handling file uploads" chapter and your silly question will vanish like a magic.
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Old 10-09-2008, 04:15 AM Re: php image upload overwrite?
Experienced Talker

Posts: 45
Trades: 0
Use the php rename function:
Quote:
rename("/tmp/tmp_file.txt", "/home/user/login/docs/my_file.txt");
http://www.php.net/rename
__________________

Please login or register to view this content. Registration is FREE
: Learn more about Web Hosting!
arbet is offline
Reply With Quote
View Public Profile Visit arbet's homepage!
 
Old 10-09-2008, 04:15 AM Re: php image upload overwrite?
rogem002's Avatar
PHP Chap

Posts: 843
Name: Mike
Location: United Kingdom
Trades: 0
http://uk2.php.net/manual/en/function.rename.php RTFM. Use the rename() function to change the files name when you move it.
__________________
My Blog/Site:
Please login or register to view this content. Registration is FREE
rogem002 is offline
Reply With Quote
View Public Profile Visit rogem002's homepage!
 
Reply     « Reply to php image upload overwrite?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.24144 seconds with 12 queries