durpal是否支持php7,php – 无法在drupal 7中添加图像字段
我是drupal的新手,現在我需要以編程方式創建節點.
我能夠創建一個簡單的節點.但如果我將它與圖像字段合并,它總是失敗.
$file_path = drupal_realpath('tmp/test_image.jpg');
$file = (object) array(
'uid' => 1,
'uri' => $file_path,
'filemime' => file_get_mimetype($file_path),
'status' => 1,
);
$copy = file_copy($file, 'public://sites/default/files/field/image/testing/', FILE_EXISTS_RENAME);
$node->field_image[LANGUAGE_NONE][0] = (array) $copy;
它總是給我一個錯誤:(
The specified file 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.
總結
以上是生活随笔為你收集整理的durpal是否支持php7,php – 无法在drupal 7中添加图像字段的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 数字 IC 技能拓展(19)带你了解一款
- 下一篇: 动态规划算法php,php算法学习之动态