webmaster74
08-25-2016, 12:36 PM
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 1472153849 at 1472153849 ---------------
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
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 1472153849 at 1472153849 ---------------
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