EAGLE EYES Posted July 19, 2009 Share Posted July 19, 2009 I am usin PHP 5.2 on IIS 7 with Fast CGI and Vista Ultimate ON USING THIS CODE I GET HTTP ERROR 404 - NOT FOUND The resource you are looking for has been removed, had its name changed, or is temporarily unavailable <html> <?php if(isset($fupload)) { print "path: $fupload<br>"; print "name: $fupload_name<br>"; print "size: $fupload_size"; copy($fupload,"f:\$fupload_name"); } ?> <body> <form enctype="multipart/form-data" action="<?php print $PHP_SELF ?>" method="POST"> <input type="hidden" name="MAX_FILE_SIZE" value="51200"> <input type="file" name="fupload"><br> <input type="submit" value="click"> </form> </body> </html> ALSO I GET BLANK SCREEN ON USING THIS CODE : <html> <body> <?php $filename="mirror.txt"; print (file_exists($filename))?"yes":"no"; $fp=fopen($filename,"r") or die("cant open"); while(!feof($fp)) { $te=fgets($fp,1024); print "$te"; } fclose($fp); ?> </body> </html> Link to comment https://forums.phpfreaks.com/topic/166484-file-uploading-and-file-handling-functions-not-working/ Share on other sites More sharing options...
trq Posted July 19, 2009 Share Posted July 19, 2009 This has what to do with hacking php's core? Link to comment https://forums.phpfreaks.com/topic/166484-file-uploading-and-file-handling-functions-not-working/#findComment-877931 Share on other sites More sharing options...
PFMaBiSmAd Posted July 19, 2009 Share Posted July 19, 2009 If you look at the "view source" of your form in your browser, you will probably find that the action="..." attribute is a php error message because $PHP_SELF was depreciated and turned off by default 7 years ago. It would be better if you used an empty action attribute to cause the page to submit to itself. action="" Link to comment https://forums.phpfreaks.com/topic/166484-file-uploading-and-file-handling-functions-not-working/#findComment-878046 Share on other sites More sharing options...
EAGLE EYES Posted July 19, 2009 Author Share Posted July 19, 2009 If you look at the "view source" of your form in your browser, you will probably find that the action="..." attribute is a php error message because $PHP_SELF was depreciated and turned off by default 7 years ago. It would be better if you used an empty action attribute to cause the page to submit to itself. action="" Following ur suggestion now i am getting a HTTP 405 Error -Method Not Allowed Link to comment https://forums.phpfreaks.com/topic/166484-file-uploading-and-file-handling-functions-not-working/#findComment-878175 Share on other sites More sharing options...
mattal999 Posted July 19, 2009 Share Posted July 19, 2009 I'm not sure about this, but you should use $_POST tags, not just variable names. Therefore, this becomes: <?php if(isset($_POST['fupload'])) { print "path: ".$_POST['fupload']."<br>"; print "name: ".$_POST['fupload']['name']."<br>"; print "size: ".$_POST['fupload']['size']; copy($_POST['fupload'], "f:\".$_POST['fupload']['name']); } ?> Link to comment https://forums.phpfreaks.com/topic/166484-file-uploading-and-file-handling-functions-not-working/#findComment-878214 Share on other sites More sharing options...
EAGLE EYES Posted July 19, 2009 Author Share Posted July 19, 2009 I'm not sure about this, but you should use $_POST tags, not just variable names. Therefore, this becomes: <?php if(isset($_POST['fupload'])) { print "path: ".$_POST['fupload']."<br>"; print "name: ".$_POST['fupload']['name']."<br>"; print "size: ".$_POST['fupload']['size']; copy($_POST['fupload'], "f:\".$_POST['fupload']['name']); } ?> It Does not work......... Link to comment https://forums.phpfreaks.com/topic/166484-file-uploading-and-file-handling-functions-not-working/#findComment-878258 Share on other sites More sharing options...
PFMaBiSmAd Posted July 19, 2009 Share Posted July 19, 2009 HTTP 405 Error -Method Not Allowed Either means that your form is not valid or that the URL of the current page + the relative URL is not valid - http://support.microsoft.com/kb/216493 , or that the server is not configured to accept the request that it received. What is the current code for the form? Link to comment https://forums.phpfreaks.com/topic/166484-file-uploading-and-file-handling-functions-not-working/#findComment-878267 Share on other sites More sharing options...
EAGLE EYES Posted July 20, 2009 Author Share Posted July 20, 2009 HTTP 405 Error -Method Not Allowed Either means that your form is not valid or that the URL of the current page + the relative URL is not valid - http://support.microsoft.com/kb/216493 , or that the server is not configured to accept the request that it received. What is the current code for the form? The BUG u are talking about is in IIS 4 and IIS 5 it has been corrected in IIS 6 and i am using IIS 7 Link to comment https://forums.phpfreaks.com/topic/166484-file-uploading-and-file-handling-functions-not-working/#findComment-878438 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.