5
如何使用entity_metadata_wrapper设置文件字段的值
使用entity_metadata_wrapper时如何设置文件字段的值? 我试过在代码中执行此操作: $file = new stdClass(); $file->uid = 1; $file->uri = $file_path; $file->filename = basename($file_path); $file->filemime = file_get_mimetype($file_path); $file->filesize = filesize($file_path); $file->status = FILE_STATUS_PERMANENT; $file->display = '1'; file_save($file); // I also tried: $file = file_save($file); $node = array( 'type' => 'news_item', 'uid' => 1, 'status' => 1, 'comment' => 0, …