$_FILES empty when trying to do a file upload

后端 未结 3 503
猫巷女王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 04:13

    Add the proper enctype attribute to your form tag:

    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']
    

提交回复
热议问题