Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将文件传递给Wordpress wp\u handle\u上载_Wordpress - Fatal编程技术网

将文件传递给Wordpress wp\u handle\u上载

将文件传递给Wordpress wp\u handle\u上载,wordpress,Wordpress,我正在尝试将文件传递给Wordpress wp\u handle\u upload。通常它应该得到$\u文件数组,所以我尝试手动创建它,比如 $uploadedfile = array ( 'filePhoto' => array ( 'name' => $name, 'type' => 'image/png', 'tmp_name' => $file, 'error' => 0, 'size' => 178890, ), ); $upload_overrid

我正在尝试将文件传递给Wordpress wp\u handle\u upload。通常它应该得到$\u文件数组,所以我尝试手动创建它,比如

$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目录。有什么提示吗

谢谢

你想要的是

上传仅用于实际上传!:)