Jump to content

Recommended Posts

;D 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"

Link to comment
https://forums.phpfreaks.com/topic/64071-problem-with-file-upload/
Share on other sites

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".

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.