是否可以将POST变量放入php $ _FILES [variable]

时间:2018-09-09 08:16:02

标签: javascript php jquery html

$ _ FILES是否可以接受变量?我print_r $ fileName,它不识别索引

HTML

   <input type="file" id="file_id">

JQUERY

   const update_image = $("#file_id");

   update_image.change(function() {

        $.post('upload_update.php', {
            pass_file: update_image.val()
        });

    })

PHP

   $getFile = $_POST['pass_file'];
   $fileName = $_FILES[$getFile]['name']; //This displays undefined index

0 个答案:

没有答案
相关问题