asherinho Posted August 9, 2007 Share Posted August 9, 2007 whts up guys? I am having a problem with uploading file,i dont see where i went wrong with the code i wrote but the script didnt upload.see the code below & help me please.the file is supposed to be uploaded to the folder called uploads which is located in drive C of my PC <?php if($userfile=="none"){ echo "no file specified"; exit; } if(move_uploaded_file($userfile, "\\uploads\\".$userfile_name)){ echo "your file has been uploaded"; }else{ echo "could not upload"} ?> the script desplays "could not upload" Quote Link to comment https://forums.phpfreaks.com/topic/64071-problem-with-file-upload/ Share on other sites More sharing options...
frost Posted August 9, 2007 Share Posted August 9, 2007 Are you executing this in your localhost? example: http://localhost/upload.php ? If so your uploads folder would need to be inside the localhost. Quote Link to comment https://forums.phpfreaks.com/topic/64071-problem-with-file-upload/#findComment-319371 Share on other sites More sharing options...
asherinho Posted August 10, 2007 Author Share Posted August 10, 2007 Yes.I tried that one too but it didnt work Quote Link to comment https://forums.phpfreaks.com/topic/64071-problem-with-file-upload/#findComment-320130 Share on other sites More sharing options...
climbjm Posted August 10, 2007 Share Posted August 10, 2007 Check out this and compare. He also explains a lot of things in his tutorial as well as keeping it simple. http://www.tizag.com/phpT/fileupload.php Also make sure that your file "upload.php" and the folder you are uploading too have the correct permissions or you will start to get all sorts of warnings or fatal errors. for more info on that google "php chmod" and google "linux chmod". Quote Link to comment https://forums.phpfreaks.com/topic/64071-problem-with-file-upload/#findComment-320136 Share on other sites More sharing options...
asherinho Posted August 10, 2007 Author Share Posted August 10, 2007 thanks climbjm,the tutorial helped me. Quote Link to comment https://forums.phpfreaks.com/topic/64071-problem-with-file-upload/#findComment-320141 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.