html like this:
- Code: Select all
<html>
<head>
<title>test php</title>
</head>
<body>
<form action="upload_file.php" method="post" enctype="multipart/form-data">
<label for="file">Filename:</label>
<input type="file" name="file" id="file" />
<br />
<input type="submit" name="submit" value="Submit" />
</form>
</body>
</html>
php like this:
- Code: Select all
<?php
error_reporting(E_ALL);
ini_set("display_errors", 1);
$filename = $_FILES["file"]["tmp_name"];
$destination = "C:\\TMP";
move_uploaded_file($filename, $destination);
echo "<br />" . $filename . "<br /><hr />" . $destination;
?>
You guessed it error messages like this:
Warning: move_uploaded_file(C:\TMP1) [function.move-uploaded-file]: failed to open stream: Permission denied in C:\Program Files\Apache Software Foundation\Apache2.2\sites\test\upload_file.php on line 7
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\TMP\php9E5.tmp' to 'C:\TMP1' in C:\Program Files\Apache Software Foundation\Apache2.2\sites\test\upload_file.php on line 7
C:\TMP\php9E5.tmp
C:\TMP1
information:
windows xp pro srv pack 3
apache 2.2
php 5.2.17
mysql ?
So my C:TMP file has full permissions for EVERYONE. I did this because i just want it to be known
that it is wide open. There shouldn't be any permission issues.
Do i need to do something in Apache http.conf file?
for the record php.ini has
safe_mode off
file_upload on
upload_max_filesize = 10000M
post_max_size = 10000M
I have restarted apache after checking these configs.
Why isn't it working?


