$_FILES empty when trying to do a file upload

后端 未结 3 502
猫巷女王i
猫巷女王i 2020-12-11 03:30

This is driving me crazy. I\'m trying to figure out how to upload a file. I\'ve got two very simple files, yet it doesn\'t seem to work. This first is the file that allow

相关标签:
3条回答
  • 2020-12-11 03:59

    Add that in Form tag

    enctype="multipart/form-data"

    0 讨论(0)
  • 2020-12-11 04:12

    You shuold use attribute enctype="multipart/form-data" in form tag.

    0 讨论(0)
  • 2020-12-11 04:13

    Add the proper enctype attribute to your form tag:

    <form action="getfile.php" method="post" enctype="multipart/form-data">
    

    It's documented here: http://www.php.net/manual/en/features.file-upload.post-method.php

    Also, make sure there's no space between your brackets when you access multi-dimensional arrays:

    $_FILES['uploadFile']['tmp_name']
    
    0 讨论(0)
提交回复
热议问题