Hello,
I am experiencing a weird problem.
I have this simple script to upload files:
<?php
$maxfilesize=2097152;
if ($HTTP_POST_FILES['lbupload']['tmp_name'] != "")
{
if (!is_uploaded_file($HTTP_POST_FILES['lbupload']['tmp_name']))
{
$error = "Error! File couldnt be uploaded.";
unlink($HTTP_POST_FILES['lbupload']['tmp_name']);
}
else
{
if ($HTTP_POST_FILES['lbupload']['size'] > $maxfilesize)
{
print $HTTP_POST_FILES['lbupload']['size'];
unlink($HTTP_POST_FILES['lbupload']['tmp_name']);
$error = "Error! The file must have no more than 2MB!";
}
else
{
copy($HTTP_POST_FILES['lbupload']['tmp_name'],"/home/livingbi/public_html/lbuploads/" . $HTTP_POST_FILES['lbupload']['name']);
unlink($HTTP_POST_FILES['lbupload']['tmp_name']);
$error = "File was successfully sent!";
}
}
}
else
{
$error = "Empty name.";
}
echo $error;
echo "<br>";
echo $HTTP_POST_FILES['lbupload']['error'];
echo "<br>";
echo $HTTP_POST_FILES['lbupload']['tmp_name'];
echo "<br>";
echo "/" . $HTTP_POST_FILES['lbupload']['name'];
?>
Ok, it works on my server. But when I try the same script in my customer server, I got no message error - in fact I get a code 0 (no error) after check the $HTTP_POST_FILES['lbupload']['error'] var, that is, everything is fine AS IF it would work. The fact, is that after finish to run the script the uploaded file IS NOT there in the server! Where it goes???
Well, the only difference between my server and my customer server, is that his one is a SFTP one. Would it be the cause of the problem???