Jump to content

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.

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.