![]() |
5000 entries in db for same file
Checking on my vbulletin 4 forums, I came across tens of ablums with 100% broken links to their uploaded images.
Looking in the attachment table, I found about 5000 entries all referring to the same file. Looking closely, the file is named keyword1_keyword2_keyword3_keyword4_keyword5_keywo rd6_keyword7_keyword8_keyword9_keyword10_keyw_.jpg OK I got it. A few years ago, I created some nice designs and pushed the SEO a bit too much by naming the files in the above way. I don't have those designs as I was very short on space on my SSD. After uploading them as attachments, I deleted them from my pc. They then looked fine... Now, the attachments are fine in their proper places as /n/n/filedataid.attach Can I fix this by renaming the files in the DB? I am good at manipulating data in Excel and re-uploading with a replace order to the DB. it would be a real pitty to have to delete 5000 files and re-create and re-upload. --------------- Added [DATE]1472153849[/DATE] at [TIME]1472153849[/TIME] --------------- This should not be very difficult to do as the files are not encrypted or modified except that they are renamed to filedataid.attach I tried simply renaming one of them to filedataid.attach.jpg and I could easily open it as a jpg. I know for a fact all of those files in question were jpg... I was thinking I am able to write a replace / update statement such as update attachment where filedataid=nnnnn set filename=new_short_name_filedataid.jpg |
Can you share a link to your site? I'm very confused. You said it's fine?
|
Quote:
|
So it's incorrectly stored in the database? Can you show us an example of what it looks like in the database and what it's supposed to look like?
|
Quote:
I have about 5000 entries in the attachment table with this under filename keyword1_keyword2_keyword3_keyword4_keyword5_keywo rd6_keyword7_keyword8_keyword9 _keyword10_keyw_.jpg Of course originally the entries were like keyword1_keyword2_keyword3_keyword4_keyword5_keywo rd6_keyword7_keyword8_keyword9 _keyword10_keyword11_some_serial_number.jpg Of course I can mass modify the entries in the mysql db... but how do those tie back with the attachments ? |
If I recall correctly, there's no strict check against the filename column in the attachment table. What matters the most is that the attachmentid exists in the attachment table.
Browsing to /attachment.php?attachmentid=XX where XX is a valid attachmentid in your table does not download/load the attachment? |
Quote:
On the website, the source of the images in the album is something like this: PHP Code:
and those do not lead to an image... they are broken links. --------------- Added [DATE]1472182313[/DATE] at [TIME]1472182313[/TIME] --------------- Quote:
I now recalled, thanks to you, that after the migration to a new server I did NOT update the path to the vbattachments folder. So sorry. Fixed now. |
But does the attachmentid 20027 exist in the attachment table?
If so, it's probably not passing a bunch of checks that are coded in /packages/vbforum/attach/album.php or /packages/vbforum/attach/post.php (look for function verify_attachment) Based on those checks, you can see what's wrong and causing the attachment to "break". Edit: guess you figured it out. :) |
Quote:
thank you much |
All times are GMT. The time now is 10:54 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|