error when trying to upload a file

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mister
Forum Newbie
Posts: 7
Joined: Sat Jan 06, 2007 11:38 am

error when trying to upload a file

Post by mister »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


when im trying to upload a file i get this error message and i dont know why i think every thing is ok with my code there is the error and the the code

Code: Select all

Warning:  move_uploaded_file(3/New Text Document.txt) [function.move-uploaded-file]: failed to open stream: No such file or directory in /var/www/localhost/inside/addCustomerDocumentDone.php on line 31

Code: Select all

$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);

if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
  echo "<html>
            <head>
                <title>Create a task</title>
                <link rel='stylesheet' type='text/css' href='CRMstyle.css' />
            </head>
        <body>
            <h5>File is valid, and was successfully uploaded.</h5>
and this is my upload dir

Code: Select all

$uploaddir    = "/var/www/localhost/inside/customersdocs/";

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
jabbaonthedais
Forum Contributor
Posts: 127
Joined: Wed Aug 18, 2004 12:08 pm

Post by jabbaonthedais »

Have you checked the folder permissions?
Post Reply