Hello everybody,
I have 2 problems.
I would like people to upload their files on my site. The problem is that my site is divided in two. The first one is the one the users see, the second is a “secret” one where the files are stored. I have a script that works really nice to upload file from the “users” site to the “users” site. However, I cannot manage to get my upload form on my “users” site and have the file uploaded on my “secret” site …
My second problem is that my script works well for zip file but strangely enough, not for rar files, any idea why ?
Thank you so much for your time and help !
here is my script :
[code=php]<?php
if ((($_FILES[“file”][“type”] == “application/zip”)
|| ($_FILES[“file”][“type”] == “application/rar”))
&& ($_FILES[“file”][“size”] < 200000))
{
if ($_FILES[“file”][“error”] > 0)
{
echo “Return Code: ” . $_FILES[“file”][“error”] . “<br />”;
}
else
{
echo “Upload: ” . $_FILES[“file”][“name”] . “<br />”;
echo “Type: ” . $_FILES[“file”][“type”] . “<br />”;
echo “Size: ” . ($_FILES[“file”][“size”] / 1024) . ” Kb<br />”;
echo “Temp file: ” . $_FILES[“file”][“tmp_name”] . “<br />”;
if (file_exists(“upload/” . $_FILES[“file”][“name”]))
{
echo $_FILES[“file”][“name”] . ” already exists. “;
}
else
{
move_uploaded_file($_FILES[“file”][“tmp_name”],
“1/” . $_FILES[“file”][“name”]);
echo “Stored in: ” . “1/” . $_FILES[“file”][“name”];
}
}
}
else
{
echo “Invalid file”;
}
?>