ilia | Ok, well it looks like you found your problem, the mime table is empty, so the select returns no records, causing the file not to be inserted into the attach table. The solution at the minimum is to insert a single entry into that table where the value of the fl_ext column is ''.
|
Sorry it's taken me so long to revisit this topic. I went on vacation shortly after my last post, and have had other priorities since I got back.
That being said, I tried populating the fud26_mime table with a couple entries (including one for GIF files), and attachments still are not working.
I tried creating an entry with an attachment (a GIF file), no luck. I then tried to edit that entry to add a GIF file, again, didn't work.
Since I've got query logging turned on in MySQL, I can show you the sequence of events (the attach attempt via edit) as far as MySQL goes. Maybe you could take a look and let me know what you think is wrong:
750151 Query SELECT t.forum_id, t.replies, t.thread_opt, t.root_msg_id, t.orderexpiry, m.subject FROM fud26_
thread t INNER JOIN fud26_msg m ON t.root_msg_id=m.id WHERE t.id=19641
750151 Query SELECT id, name, max_attach_size, forum_opt, max_file_attachments, post_passwd, message_thresho
ld FROM fud26_forum WHERE id=7
750151 Query SELECT group_cache_opt, 1 as md FROM fud26_group_cache WHERE user_id IN(2543,2147483647) AND re
source_id=7 ORDER BY user_id ASC LIMIT 1
750151 Query INSERT INTO fud26_attach (location,message_id,original_name,owner,attach_opt,mime_type,fsize) S
ELECT '', 0, 'dog.gif', 2543, 0, id, 5073 FROM fud26_mime WHERE fl_ext IN('', 'gif') ORDER BY fl_ext DESC LIMIT 1
750151 Query SELECT with_str, replace_str FROM fud26_replace WHERE replace_str IS NOT NULL AND with_str IS N
OT NULL AND LENGTH(replace_str)>0
750151 Query LOCK TABLES fud26_fl_7 WRITE
750151 Query UNLOCK TABLES
750151 Query UPDATE fud26_msg SET
file_id=70000,
foff=10316402,
length=42,
mlist_msg_id='11034(dot)44f316e4(at)test(dot)com',
file_id_preview=0,
offset_preview=0,
length_preview=0,
updated_by=2543,
msg_opt=0,
attach_cnt=1,
poll_id=0,
update_stamp=1156782395,
icon=NULL ,
poll_cache=NULL,
subject='testing'
WHERE id=69684
750151 Query SELECT orderexpiry, thread_opt, root_msg_id FROM fud26_thread WHERE id=19641
750151 Query UPDATE fud26_thread SET thread_opt=0, orderexpiry=1000000000 WHERE id=19641
750151 Query SELECT seq FROM fud26_tv_7 ORDER BY seq DESC LIMIT 1
750151 Query SELECT fud26_thread.id FROM fud26_tv_7
INNER JOIN fud26_thread ON fud26_thread.id=fud26_tv_7.thread_id
INNER JOIN fud26_msg ON fud26_thread.root_msg_id=fud26_msg.id
WHERE fud26_tv_7.id>1078
AND fud26_tv_7.iss>0
AND fud26_thread.thread_opt>=2
AND (fud26_msg.post_stamp+fud26_thread.orderexpiry)<=1156782395
750151 Query DELETE FROM fud26_thread WHERE forum_id=7 AND moved_to>0 AND last_post_date<1156523195
750151 Query LOCK TABLES fud26_tv_7 WRITE, fud26_thread READ, fud26_msg READ
750151 Query SET @seq=0
750151 Query DELETE FROM fud26_tv_7
750151 Query INSERT INTO fud26_tv_7 (thread_id,iss,seq) SELECT fud26_thread.id, (thread_opt & (2|4)), (@seq:
=@seq+1) FROM fud26_thread
INNER JOIN fud26_msg ON fud26_thread.root_msg_id=fud26_msg.id
WHERE forum_id=7 AND fud26_msg.apr=1
ORDER BY (CASE WHEN thread_opt>=2 THEN (4294967294 + fud26_thread.last_post_date) ELSE fud26_thread.last_post_date
END) ASC
060828 10:26:36 750151 Query UNLOCK TABLES
750151 Query DELETE FROM fud26_index WHERE msg_id=69684
750151 Query DELETE FROM fud26_title_index WHERE msg_id=69684
750151 Query INSERT IGNORE INTO fud26_search (word) VALUES ('testing'),('this'),('test'),('see'),('attachmen
ts'),('work')
750151 Query INSERT INTO fud26_title_index (word_id, msg_id) SELECT id, 69684 FROM fud26_search WHERE word I
N('testing')
750151 Query INSERT INTO fud26_index (word_id, msg_id) SELECT id, 69684 FROM fud26_search WHERE word IN('tes
ting','this','test','see','attachments','work')
750151 Query DELETE FROM fud26_attach WHERE message_id=69684
750151 Query SELECT a.id, a.original_name, a.fsize, a.dlcount, COALESCE(m.icon, 'unknown.gif') FROM fud26_at
tach a LEFT JOIN fud26_mime m ON a.mime_type=m.id WHERE message_id=69684 AND attach_opt=0
750151 Query UPDATE fud26_ses SET data=NULL WHERE id=625014
750151 Quit
I'd be glad to provide any additional log output if need be, or run queries against the db to provide you with more debugging data.
Thanks again.
Update Found the problem! Entries in fl_ext were preceded with a . (dot). Updating the table to remove the . in front of gif, et al did the trick.
FWIW, I got a SQL error when trying to add an 'Unknown' mime type without a file extension.
[Updated on: Mon, 28 August 2006 16:41] Report message to a moderator
|