0
我試圖從$_FILES
數組上傳文件。但在drupal7中出現錯誤。
The specified file temporary://fileOYnPHK could not be copied, because the destination directory is not properly configured.
This may be caused by a problem with file or directory permissions. More information is available in the system log.
的sites/default/files
有權777
這裏是我的代碼
if($_FILES['files']['name']['field_tenant_review_ref_und_form_field_tenancy_document_und_0']){
$file_path = file_save_data(file_get_contents($_FILES['files']['tmp_name']['field_tenant_review_ref_und_form_field_tenancy_document_und_0']),
'public://sites/default/files/'.$_FILES['files']['name']['field_tenant_review_ref_und_form_field_tenancy_document_und_0']);
}
//$tenant_review->field_tenancy_document->file->set($file_path);
是否有任何代碼的錯誤?請建議。