Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
  #1  
Old 07-25-2005, 03:42 PM
tfw2005 tfw2005 is offline
 
Join Date: Sep 2004
Posts: 58
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Direct Link to Attachments

Is there any hack, or can one be done, that when a person uploads the attachment via the normal upload system, the link in the corresponding post, shows up as a direct link to the file, not a php string driven url?

Like, you upload, and then it shows http://yoursite.com/attachments/file.jpg etc etc?

I am trying to reduce overall stress on my server by removing unnecessary database calls. I know I will lose tracking stats related to attachments, but, I really do not care about that at the moment.

I think if this system is in place, placing an anti-remote file linking setting will also work.

Thanks in advance.

EDIT: In relation to images, I would like the thumbnail system to stay in affect, so in theory the hack would produce

Code:
<a href="http://www.yoursite.com/attachments/file.jpg"><img src="http://www.yoursites.com/attachments/filethumb.jpg"></a>
Reply With Quote
  #2  
Old 08-03-2005, 05:01 AM
tfw2005 tfw2005 is offline
 
Join Date: Sep 2004
Posts: 58
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

bump

anything?
Reply With Quote
  #3  
Old 08-03-2005, 05:10 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Do you have your attachments stord in the database, or in the file system?
Reply With Quote
  #4  
Old 08-03-2005, 03:53 PM
tfw2005 tfw2005 is offline
 
Join Date: Sep 2004
Posts: 58
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

file system

i looked in the folder, and they are just a string of code, file names get removed and no extentions.
Reply With Quote
  #5  
Old 08-03-2005, 04:37 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Then there is almost no stress being placed on the system via the attachment systems.
Reply With Quote
  #6  
Old 08-03-2005, 04:57 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

They will have the attachmentid as name i think.

And they are stored in a subdirectory based on teh userid:

User id: 54321

Directory: images/attach/5/4/3/2/1/
Reply With Quote
  #7  
Old 08-03-2005, 05:00 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarcoH64
They will have the attachmentid as name i think.

And they are stored in a subdirectory based on teh userid:

User id: 54321

Directory: images/attach/5/4/3/2/1/
It depends Marco how the attachment directory was originaly setup, if its under the webroot it can have any path it wants, actually it can have any path it wants perioid.

The attachments are stored as .attach and .thumb (for thumbnails) so there is no way to direct link to them without re-writing the entire system almost.

Ontop of all that you'd lose any sort of permissions you had on attachments if someone knew the url.
Reply With Quote
  #8  
Old 08-04-2005, 09:02 PM
tfw2005 tfw2005 is offline
 
Join Date: Sep 2004
Posts: 58
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks guys, I figured what you said was true but just checking.

The main thing that kills us regarding attachments is that we are using a portal system on the main page, and when hot or new images are released, everyone loads that page and clicks the thumbnail, even if we have the full gallery in a non DB/VB system.

Once we stopped using thumbs on main page via the attachment system, the crashes became less frequent immediately.

I rigged a form upload with auto thumb creation in the newthread bit which only admins/staff can see, and it outputs the thumb-with-link-to-full code, so they can copy paste it into thread. 1 extra step than regular attach file process via VB. Looks same to users, better for server.

If we are going to get slammed with image requests, Id rather not have to access the DB period. That is....

Am I correct in thinking that when attachment.php is called, it has to access the physical file location in the DB and then load the image/file into the browser?
Reply With Quote
Reply

Thread Tools
Display Modes

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 11:03 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05593 seconds
  • Memory Usage 2,223KB
  • Queries Executed 13 (?)
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_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)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_postinfo_query
  • fetch_postinfo
  • 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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete