Home  >  Q&A  >  body text

Teacher, when I was uploading pictures, it prompted me to upload files illegally.

QQ图片20171102144517.png

# if($_FILES['pic']['tmp_name'] , //Set the attachment upload size

                    $upload->exts = array('jpg', 'gif', 'png', 'jpeg');//  Set the attachment upload type

$upload->rootPath ='./'; // Set the root directory for uploading attachments

              $upload->savePath = './Public/Uploads/'; // Set the (sub)directory for uploading attachments

                                                                                                                                                                                                                                                                                                    Upload error message

                                                $this->error($upload->getError()); #FOREACH ($ Info as $ File) {

Echo $ File ['Savepath']. $ FILE ['Savename']; >success('Upload successful!');

                                                                                                                                                

I don’t know how to solve it. Can the teacher help me?

若曦相依若曦相依2566 days ago1902

reply all(4)I'll reply

  • PHP中文网

    PHP中文网2017-11-03 09:02:17

    Didn’t you already give an error message? ! ! You check the size, size, format, etc. of your image. If they all meet the requirements, then look at the code


    reply
    1
  • 若曦相依

    The image size and format are all consistent

    若曦相依 · 2017-11-03 15:33:39
  • 天蓬老师

    天蓬老师2017-11-02 22:08:09

    What is your version of ThinkPHP?

    reply
    0
  • 若曦相依

    TP3.2.3 version

    若曦相依 · 2017-11-03 09:12:34
  • Cancelreply