Ask PHP upload file error solver

Source: Internet
Author: User
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;
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.