Any help on this appreciated. The follwoing code works on my IIS server but not my linux server, any ideas?
<?
if ($userfile=="none")
{
echo "Problem: No file has been received.";
exit;
}
if ($userfile_type!="text/plain")
{
echo "<font color='red'>Problem:</font> File does not appear to be plain text.
Only upload plain .txt documents<br> Press back and try again.";
exit;
}
if ($userfile_size=="0")
{
echo "Problem: Uploaded file is empty.";
exit;
}
if (!is_uploaded_file($userfile))
{
echo "Problem: Security warning, possible file upload exploit.
Process shutdown";
exit;
}
$savepath = $directory."campid-".$row_rsCampaign['campaign_id'];
$savepath = $savepath."-created-".date("U");
$savepath = $savepath."-ran-";
srand(time());
$random = (rand()%999999);
$savepath = $savepath.$random;
$savepath = $savepath.".txt";
$upfile = $savepath;
if (!copy($userfile, $upfile))
{
echo "Could not store the uploaded file";
exit;
}
echo "...Analyzing uploaded file contents...<br>";
.........
The page which sends the file contains the following:
<form enctype="multipart/form-data" action="upload.php?campaign_id=<?php echo $row_rsCampaign['campaign_id']; ?>&client_id=<?php echo $row_rsClient['client_id']; ?>" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="1000">
<input type="file" name="userfile">
<input type="submit" value="Send File"></p>
</form>
Basically my linux server constantly tells me that 'File does not appear to be plain text.' This was all from a manual, and cant find what the problem is... TIA svenski