echo ""; $fileName=$_FILES["file"]["name"];      //获取文件的名称 //echo $fileName;die(); $fileType=explode(".",$fileName); $fileTypeName=$fileType[count($fileType)-1]; $typeArray=array("JPEG","gif","bmp"); //文件上传的规格类型 if(!in_array($fileTypeName,$typeArray)) { echo "格式错误 本例只许上传图片格式为gif bmp和jpeg 请点击这里返回从新选择图片"; die(); } if($_FILES['file']['error']>0) { echo "文件上传失败"; } else { if(is_uploaded_file($_FILES['file']['tmp_name'])) { if(move_uploaded_file($_FILES['file']['tmp_name'],'images/'.$_FILES['file']['name'])) { //move_uploaded_file方法是,当你上传图片(文件)的时候,首先将图片(文件)保存在系统的临时目录中,然后通过move_uploaded_file方法,将文件传入指定的目录当中,第一个参数为文件的临时文件名,第二个参数为文件传入的目录指定。 echo "文件上传成功"; } else { echo "移动目标位置失败"; } } else { echo "文件未被上传"; } } ?>

Words translated by CCJK


Request a call or contact us


    Call for professional assistance


    Click Here to leave us a message and be as detailed as possible.

We are Certified

Our Client Satisfaction

rating for previous quarte

    Inquiry Form

    Please take few minutes to fill
    inquiry form and get Free Quote

    Request a Call

    Click to receive Free Call, Our
    Representative will contact you

    Leave a Message

    Please leave us a message and
    be as detailed as possible

Over 95% of our clients recommend our language services to others

Copyright © CCJK Technologies Co., Ltd. 2000-2017. All rights reserved.