it uses 2 pages and a form(as is expected) the data is saved into
userfile
the first page is for submitting wich is working fine.
but the second file(the saving file) does generate a problem upon trying to save the file
to given directory. I will mark where i think the problem is occuring
the file i always try to upload is a zip file of 1kb
already tried to us enctype='application/zip'
submit page:
Code: Select all
//the url for this part is: http://www.myintranetsite.com/website/main.php
echo "<form action='upload.php' method='POST' enctype='multipart/form-data'> ";
echo "submit this file: <input type=file name='userfile'><br>";
echo "<input type=submit value=submit></form> <br>";Code: Select all
//the url for this part is: http://www.myintranetsite.com/website/upload.php
//this is for error generation wich gives me nothing
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
//it displays this
echo "script start <br> <br>";
if(!empty($_FILES["userfile"]))
{
// in the main site the upload dir is: http://www.myintranetsite.com/website/upload
$uploaddir = "/upload/" ;
//copy the file to the permanent location
if (move_uploaded_file($_FILES["userfile"]["tmp_name"], $uploaddir . $_FILES["userfile"]["name"]))
{
echo("file uploaded");
}
else
{
echo ("error!");
}
}
// i put this in to see if it could do the above if statement
// this line is what this script alwas shows
else {
echo "ryuuka has created an error";
}but it doesn't.
any solutions/hints or pointers