PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old May 16th, 2004, 10:51 AM
oasis oasis is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 1 oasis User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Copying a picture in one folder to another using php

I tried copy(filepath, "file_destination"); but it did not work. How can I copy a picture file from one folder to another using php on Linux?

Last edited by oasis : May 16th, 2004 at 10:54 AM. Reason: left quotation mark

Reply With Quote
  #2  
Old May 17th, 2004, 11:07 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
That's roughly how you do it, though presumably you're actually using real quoted or variable values rather than what you've supplied here. If it doesn't work, chances are that the Web server simply doesn't have permission on the folder you're trying to copy to.
__________________
Please don't PM me asking for solutions outside the scope of a thread.
Keeping all responses in a thread stands to help others who come along later,
which is after all what this forum's all about.

Reply With Quote
  #3  
Old May 19th, 2004, 11:22 AM
q3utom q3utom is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 16 q3utom User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
PHP Code:
 move_uploaded_file($_FILES['pic_filename']['tmp_name'],"".$_SERVER['DOCUMENT_ROOT']."/images/album/$directoryname/".$_FILES['pic_filename']['name'].""); 
chmod($_SERVER['DOCUMENT_ROOT']."/images/album/$directoryname/".$_FILES['pic_filename']['name'],0777); 
copy($_SERVER['DOCUMENT_ROOT']."/images/album/$directoryname/".$_FILES['pic_filename']['name'],"".$_SERVER['DOCUMENT_ROOT']."/images/album/$directoryname/$dirname_thumb/".$thumb_name);
chmod($_SERVER['DOCUMENT_ROOT']."/images/album/$directoryname/$dirname_thumb/$thumb_name",0777); 


is what I use. Make sure the directories you are moving files to have the CHMOD setting of 777 otherwise it won't work.

Reply With Quote
  #4  
Old May 20th, 2004, 06:13 PM
Pheifel Pheifel is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: Denmark
Posts: 174 Pheifel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 43 m 46 sec
Reputation Power: 5
Send a message via MSN to Pheifel
And make sure, that the server is not under safemode. This may interrupt the transfer.(sorry for the spelling )

- Pheifel

Reply With Quote
  #5  
Old May 21st, 2004, 05:15 AM
q3utom q3utom is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 16 q3utom User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Does safemode effect move_uploaded_file? I thought it only affected things like mkdir or rmdir. Or is it variable between servers?

Reply With Quote
  #6  
Old May 26th, 2004, 11:08 PM
Pheifel Pheifel is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: Denmark
Posts: 174 Pheifel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 43 m 46 sec
Reputation Power: 5
Send a message via MSN to Pheifel
i have had trouble uploading under safemode. Some renaming of files is not allowed under safemode as is some PHP rename functions and other name related and file related functions not allowed under safemode.

Reply With Quote
  #7  
Old May 27th, 2004, 05:34 AM
q3utom q3utom is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 16 q3utom User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
well email your hoster and ask them to relax the UID check on safemode.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > Copying a picture in one folder to another using php


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT