Drupal 7 开发内部培训资料, 分头诗人

奇怪的file_managed上传问题

赞成!
0
否决!

在form表单定义一个普通的file_manged,然后ajax上传。

大部分图片上传是没问题的,小部分图片上传却报如下错误
一个AJAX HTTP请求异常终止。
调试信息如下。
路径:/file/ajax/push_groups/0/ico/form-VPDHXvaj3jOQHrGClPmhQYa8eXm_KlK2AUR88JtHl_E
状态文本: n/a
响应文本:
爱游小组
错误         
图档已经重新缩小过,以符合所允许的最大尺寸: 160x120 像素。
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'public://group_push_pic/12_2.jpg' for key 'uri': INSERT INTO {file_managed} (uid, filename, uri, filemime, filesize, status, timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6); Array
(
[:db_insert_placeholder_0] => 1
[:db_insert_placeholder_1] => 12.jpg
[:db_insert_placeholder_2] => public://group_push_pic/12_2.jpg
[:db_insert_placeholder_3] => image/jpeg
[:db_insert_placeholder_4] => 5168
[:db_insert_placeholder_5] => 0
[:db_insert_placeholder_6] => 1388658568
)
在 drupal_write_record() (行 7166 在 /home/wwwroot/includes/common.inc).
网站遇到了不可预知的错误。请稍后再试。          

准备状态: undefined

看不出哪里错了?请指点,谢谢

 

1 个回答

赞成!
0
否决!

这好像是你的问题

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '' for key 2: INSERT INTO {file_managed}