Please ask PHP upload file error solver!
This post was last edited by l34827584 on 2014-05-10 18:06:37
Normal under Windows But Linux prompts to move files failed for help!
The code is as follows
Include ". /connss.php ";
Include ". /checka.php ";
?>
$uptypes =array (
' Image/jpg ',
' Image/jpeg ',
' Image/png ',
' Image/pjpeg ',
' Image/gif ',
' Image/bmp ',
' Image/x-png ',
);
$max _file_size=2000000;
$destination _folder= ". /.. /img/slider/";
$filesname =$_post[title];
$id =$_post[id];
$link =$_post[linke];
if ($_server[' request_method '] = = ' POST ')
{
if (!is_uploaded_file ($_files["Upfile"][tmp_name]))
Whether the file exists
{
echo "Picture does not exist!";
Exit
}
$file = $_files["Upfile"];
if ($max _file_size < $file ["size"])
Check File size
{
echo "File too big!";
Exit
}
if (!in_array ($file ["type"], $uptypes))
Check file types
{
echo "file type does not match!". $file ["type"];
Exit
}
if (!file_exists ($destination _folder))
{
mkdir ($destination _folder);
}
$filename = $file ["Tmp_name"];
$image _size = getimagesize ($filename);
$pinfo =pathinfo ($file ["name"]);
$ftype = $pinfo [' extension '];
$destination = $destination _folder.time (). ".". $ftype;