我正在尝试将文件传递给Wordpress wp_handle_upload。通常它应该得到$ _FILES数组,所以我尝试手动创建它,比如
$uploadedfile = array ( 'filePhoto' => array ( 'name' => $name, 'type' => 'image/png', 'tmp_name' => $file, 'error' => 0, 'size' => 178890, ), );
$upload_overrides = array( 'test_form' => false );
$movefile = wp_handle_upload( $uploadedfile, $upload_overrides );
但由于某种原因,文件未复制到uploads目录。任何提示?
谢谢