PhP-c0DeR Posted December 7, 2009 Share Posted December 7, 2009 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... Quote Link to comment https://forums.phpfreaks.com/topic/184237-help-with-upload-on-wamp/ Share on other sites More sharing options...
PFMaBiSmAd Posted December 7, 2009 Share Posted December 7, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/184237-help-with-upload-on-wamp/#findComment-972659 Share on other sites More sharing options...
Infected.Shadow Posted December 7, 2009 Share Posted December 7, 2009 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']; ?> Quote Link to comment https://forums.phpfreaks.com/topic/184237-help-with-upload-on-wamp/#findComment-972661 Share on other sites More sharing options...
PhP-c0DeR Posted December 7, 2009 Author Share Posted December 7, 2009 infected.shadow, thank you very much, PFMaBiSmAd you too. Quote Link to comment https://forums.phpfreaks.com/topic/184237-help-with-upload-on-wamp/#findComment-972679 Share on other sites More sharing options...
FaT3oYCG Posted December 7, 2009 Share Posted December 7, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/184237-help-with-upload-on-wamp/#findComment-972680 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.