file upload error<

liunx

Guest
I am getting a "The page cannot be displayed" message everytime I try using the 'file' type input in an html form.
The server administrator says it should work but it does not.
Here is the code for the whole page.

<html>
<head>
<title>Add Photos</title>
</head>
<body>
<h1>Photo Upload Page</h1>
<FORM ENCTYPE="multipart/form-data" METHOD="POST" ACTION="add3.php" NAME="test">
<input type="hidden" name="MAX_FILE_SIZE" value="1000">
<input name="userfile" type="file" size="85">
<input name="Submit" type=submit value="Upload File">
</form>
</body>
</html>add3.php DOES exist yes?

Make sure it's chmod 755, it may have incorrect permissions. ??I moved this here as it seems it is a serverside error. what is the code for your php page?Yes, add3.php does exist but it does not seem to make any difference. I have reduced the code on this page to this:
<html>
<head>
<title>test page</title>
</head>
<body bgcolor="#FFFFcc" text="#000000">
<center><font size=4>test</font><br></center
</body>
</html>
This does not seem to make any difference.
I have bugged the site administrators several times about the permissions already. They appear to be set correctly.
The only way I can make this target page appear is to change the method to GET. But then the file does not get sent.
I am stumped and am hoping someone can help.
PS. It is not the file size either.no we need the php part of the page, not the html. only serverside code can upload a file, not html.I have been using this plain html page because I know there is no code here that will prevent the page from loading.
I can show you the code I was trying to use but I didn't ever load anyways. I have just been eliminating things trying to find the root of the problem. The problem seems to be that when I use the file type input in a form the server will not process it. No page is loaded, html or php. If I change the filetype to text or the method to GET the next page will load.
<?
// copy uploaded file to directory
if (is_uploaded_file($_FILES['userfile']['tmp_name'])) {
echo "yahoo!<br>";
copy($_FILES['userfile']['tmp_name'], "/home/httpd/vhosts/domain path/httpdocs/photos/$filename");
} else {
echo "Possible file upload attack. Filename: " . $_FILES['userfile']['name'];
}
chmod ("/home/httpd/vhosts/bethelgospelcamp.com/httpdocs/photos/$filename", 0755); // octal; correct value of mode

?>

This one really has me stumped.ifyou get a page cannot be dispalyed than it cannot be teh html. it has to be the php side of things. now stick that code in a file all by itself. then run it, it should display the "file uplaod attack" message, if it doesn't then you have issues with that or your host doesn't support php. double check that the file is in the right spot and all that stuff. make sure the folder is chmoded already to support the upload.I can open the target page directly with the appropriate warning messages. PHP is running and the tmp folder is set up. But how can it be a problem with the target page if the server is not even opening it? There are no page errors, just a file not found message.
I just tried it in Netscape. It will not go to the next page but just gives a little popup message saying that the document contains no data.and you are souble sure that the add3.php is in the same folder as this html form is?

if so then tell your host they have problems.Triple sure. They are side by side.
Thanks for the help.worked for meWow! well I guess I have a different problem than I thought. Thanks again.
 
Back
Top