Jump to content

help with upload on wamp


PhP-c0DeR

Recommended Posts

i cant create upload script with wamp...

i have used this code:

 

<?php
if (isset($_POST["check_if_press"]) && $_POST["check_if_press"] == "send_file") 

{

    if (!empty($_FILES["my_file"]["name"])) 
    {
        $dir = getcwd()."/";
        move_uploaded_file($_FILES["my_file"]["tmp_name"] , $dir.$_FILES["my_file"]["name"]); 
        echo "Weldone, You have been uploaded the file.";
    }

}
?>

<form action="<?php echo $PHP_SELF; ?>" method="post" enctype="multipart/form-data"> 
    Upload file: <input type="file" name="my_file" /><br />
  <input type="submit" name="check_if_press" value="send_file"  />
</form> 

anyway thanks about the help... and sorry about the english...  :shy:

Link to comment
https://forums.phpfreaks.com/topic/184237-help-with-upload-on-wamp/
Share on other sites

The code you are trying has no error checking or error reporting logic in it to get it to tell you why it is failing. Try the code at this link -

http://www.phpfreaks.com/forums/index.php/topic,278952.msg1320835.html#msg1320835

 

Not sure if this relevant to your problem though it may help later:

 

<form action="<?php echo $PHP_SELF; ?>" method="post" enctype="multipart/form-data"> 
    Upload file: <input type="file" name="my_file" /><br />
  <input type="submit" name="check_if_press" value="send_file"  />
</form>  

 

I don't see $PHP_SELF declared anywhere before hand, so I think you mean to put

 

<?php echo $_SERVER['PHP_SELF']; ?>

have you increased the max_post_size and max_file_upload_size? i think that is what they are called, open your php.ini via the wamp menu and search for them, hey need to be slightly larger than the biggest file size you would like to allow to be uploaded.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.