Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-25-2016, 12:36 PM
webmaster74 webmaster74 is offline
 
Join Date: Mar 2007
Posts: 193
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 08-25-2016, 10:56 PM
RichieBoy67's Avatar
RichieBoy67 RichieBoy67 is offline
 
Join Date: Apr 2004
Location: CT - Down in a hole..
Posts: 3,057
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can you share a link to your site? I'm very confused. You said it's fine?
Reply With Quote
  #3  
Old 08-26-2016, 12:26 AM
webmaster74 webmaster74 is offline
 
Join Date: Mar 2007
Posts: 193
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by RichieBoy67 View Post
Can you share a link to your site? I'm very confused. You said it's fine?
I said the attachments are fine in their places, that is they are indeed where you expect them to be ... in the attachments folder. However, they do not show up at all on the website....
Reply With Quote
  #4  
Old 08-26-2016, 12:58 AM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #5  
Old 08-26-2016, 01:01 AM
webmaster74 webmaster74 is offline
 
Join Date: Mar 2007
Posts: 193
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dave View Post
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?
Hi Dave.

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 ?
Reply With Quote
  #6  
Old 08-26-2016, 01:06 AM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #7  
Old 08-26-2016, 01:20 AM
webmaster74 webmaster74 is offline
 
Join Date: Mar 2007
Posts: 193
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dave View Post
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?
thank you for this.

On the website, the source of the images in the album is something like this:
PHP Code:
http://domain.com/forum/attachment.php?attachmentid=20027&d=1426709651 

and those do not lead to an image... they are broken links.

--------------- Added [DATE]1472182313[/DATE] at [TIME]1472182313[/TIME] ---------------

Quote:
Originally Posted by Dave View Post
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?
I apologize.... I most humbly say I am sorry....

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.
Reply With Quote
  #8  
Old 08-26-2016, 01:35 AM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Благодарность от:
MarkFL
  #9  
Old 08-26-2016, 03:20 AM
webmaster74 webmaster74 is offline
 
Join Date: Mar 2007
Posts: 193
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dave View Post

Edit: guess you figured it out.
You did, when you mentioned that the filename does not matter.... you logically lead me to conclude that if the files are available in their folder, then ... it is the path to them that is broken!

thank you much
Reply With Quote
Благодарность от:
MarkFL
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:34 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05429 seconds
  • Memory Usage 2,253KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (2)post_thanks_box_bit
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete