Hi, i am currently trying to upload files to my server using a small script i wrote. I am using windows nt 4.0 and php 4.0.3. here is the very small bit of script im using.
- this first file is the html page that ask for the file:
echo ("
<form action=\"upload.php\" method=POST enctype=\"multipart/form-data\">
submit this file: <input type=FILE name=\"userfile\"><br>
<input type=submit><br>
</form>
");
?>
- this second is the page that receives the data, tells what it is and copies it to a select location:
<!-- upload.php -->
You submitted this file:<BR><BR>
Name: <? echo($userfile); ?><BR>
Original Name: <? echo($userfile_name); ?><BR>
Size: <? echo($userfile_size); ?><BR>
Type: <? echo($userfile_type); ?><BR>
<?
if (copy($userfile, $directory)) {
echo("<B>File successfully copied!</B>");
} else {
echo("<B>Error: failed to copy file...</B>");
}
// Destroy the file now we've copied it
unlink($userfile);
?>
.. In this second code, I have two problems. when setting the COPY() function with destination value of "C:\somedirectory" I get a permissions error. set it to "/temp/" location in the same folder as my upload scripts, then everything works fine and i get a Success! file copied sucessfully!. BUT, here is the problem. the file isn't copied anywhere! I can't find any file where I have had "success" I have read about the problems that are involved with file uploads and windows systems. if anyone is using windows and actually has a file upload script working, please post and let me know how you did it. thanks
blue