A
Anonymous
Guest
Hi there,
i have read in the forums that i need to enable uploading for the webserver. Does that include for apache 2? I went through the config for it, & i can't find any upload thing for apache.
I have enable upload in php to this folder "e:/upload". But, it is unable to upload the file. No error was displayed, only the message "Couldn't copy the file" which is in the code. This is the html code, followed by the php code.
<html>
<head>
<title>Upload a file</title>
</head>
<body>
<h1>Upload a File</h1>
<form method = "post" Action = "do_upload.php" enctype = "multipart/form-data">
<P><strong>File to be Upload : </strong><br>
<input type = "file" Name = "img1" size="50"></p>
<p><input type = "submit" Name = "submit" value="upload file"></p>
</form>
</body>
</html>
<?
if ($img1_name != "") {
@copy("img1", "e:/upload/$img1_name") or die("Couldn't copy the file");
} else {
die("No input file specified");
}
?>
<html>
<head>
<title>Successful File Upload</title>
</head>
<body>
<h1>Success!</h1>
<P>You send :<? echo "$img1_name"; ?>, a <? echo "img1_size"; ?> byte file with a mime type of <? echo "$img1_type"; ?> </p>
</body>
</html>
i have read in the forums that i need to enable uploading for the webserver. Does that include for apache 2? I went through the config for it, & i can't find any upload thing for apache.
I have enable upload in php to this folder "e:/upload". But, it is unable to upload the file. No error was displayed, only the message "Couldn't copy the file" which is in the code. This is the html code, followed by the php code.
<html>
<head>
<title>Upload a file</title>
</head>
<body>
<h1>Upload a File</h1>
<form method = "post" Action = "do_upload.php" enctype = "multipart/form-data">
<P><strong>File to be Upload : </strong><br>
<input type = "file" Name = "img1" size="50"></p>
<p><input type = "submit" Name = "submit" value="upload file"></p>
</form>
</body>
</html>
<?
if ($img1_name != "") {
@copy("img1", "e:/upload/$img1_name") or die("Couldn't copy the file");
} else {
die("No input file specified");
}
?>
<html>
<head>
<title>Successful File Upload</title>
</head>
<body>
<h1>Success!</h1>
<P>You send :<? echo "$img1_name"; ?>, a <? echo "img1_size"; ?> byte file with a mime type of <? echo "$img1_type"; ?> </p>
</body>
</html>