General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

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 March 25th, 2004, 07:20 AM
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
Question Im getting funny errors

Hey. Im having a bit of a problem.

I have made the following upload code :

PHP Code:
<?

if ($myfile && $navn && $besk) {

    
$file_type=$_FILES['myfile']['type']; 
    
$file_upload=$_FILES['myfile']['tmp_name']; 
    
$file_error=$_FILES['myfile']['error']; 
    if (
is_uploaded_file($_FILES['myfile']['tmp_name'])) {
    
$dest 'uploads/tegninger/'.$USERID.'/';
    
copy ($_FILES['myfile']['tmp_name'],$dest);
    
mysql_query("INSERT  INTO  USER_uploads ( a lot of personal user data) VALUES ( more personal user data)
    or die(mysql_error()); 
    
    }
}
?>


But my problem is, that i get the following error when trying to upload a picture:

PHP Code:
 Warningcopy(uploads/tegninger/1/): failed to open streamIs a directory in /customers/sickworld.org/sickworld.org/httpd.www/kampp/tb/upload_tegning.php on line 13 


And i cant wuite figure out whats happening. If somone can explain and help getting rid of it, please give your oppinions.

- Pheifel

Reply With Quote
  #2  
Old March 25th, 2004, 08:42 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
Try appending a filename to the end of $dest. I think what's happening is that PHP thinks you're trying to copy a file on top of (rather than into) a directory. Provide the the path to the filename rather than just the directory to copy into and you should be good (permissions willing).
__________________
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 March 25th, 2004, 09:56 AM
ChrisIves ChrisIves is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 8 ChrisIves User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Off topic: Didn't know the PHP parser had a sense of humor

Reply With Quote
  #4  
Old March 25th, 2004, 04:33 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
an examplep please

Hi... im not sure what u mean. Can u make an example ?!...


- Pheifel

Reply With Quote
  #5  
Old March 26th, 2004, 11:19 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
PHP Code:
//Stick the temp name (or a new name) on the end of $dest
$dest 'uploads/tegninger/'.$USERID.'/' $_FILES['myfile']['tmp_name'];

//And copy the file itself rather than the name into the file at $dest.
copy ($_FILES['myfile']['tmp_file'],$dest); 

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > Im getting funny errors


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 4 hosted by Hostway
Stay green...Green IT