我试图通过自定义表单将文件上载到WordPress目录,但无法上载。我的代码是:
<input type="file" name="attachment">
<?php
$uploaddir= \'/home/a796f80a/induri.com/attachment/\';
$attachment=$uploaddir.basename($_FILES[\'attachment\'][\'name\']);
move_uploaded_file($_FILES[\'attachment\'][\'tmp_name\'], $attachment);
?>
我得到的错误是:数组([附件]=>数组([名称]=>testfile.txt[类型]=>文本/普通[tmp\\u名称]=>/tmp/phpGZYCbR[错误]=>0[大小]=>0))