我们有一个允许用户上传文件的基本表单。表单有一个<input type="file">
,在做一些验证后,我们保存文件如下:
if($file_upload) {
// this is a file that we can upload and manage
rename($_FILES['file']['tmp_name'], ABSPATH . 'path/to/files/file_' . $user_resume_record_id[0]->id . '.' . $file_extension);
}
保存文件的父方向的权限为 755。由于某种原因,我们上传的新文件以 600 的权限到达,因此用户以后看不到它们。我们做错了什么?