vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Restricting Download speed on attachements. (https://vborg.vbsupport.ru/showthread.php?t=60114)

Milhouse 01-12-2004 05:33 PM

Restricting Download speed on attachements.
 
At this point in time, if one is to download an attachement from our forums he will be able to use up all of the line as long as his internet connections allows him to.

What i was wondering, is it possibly to put a restriction on mysql attachemnts so that users can only download at say a maximum speed of 30k/s instead of the 200k/s they are getting ?

Thanx you

Andreas 01-12-2004 06:42 PM

File attachment.php, at the very end

Replace
PHP Code:

echo $attachmentinfo["$imagetype"]; 

With
PHP Code:

// UploadBandwithLimitHack
// Original line: echo $attachmentinfo["$imagetype"];
$bandwidth 30// Desired max. bandwidth in KB/s.
$i 0;
while (
$i strlen($attachmentinfo["$imagetype"])) {
  echo 
substr($attachmentinfo["$imagetype"], $i1024);
  
$i += 1024;
  
flush();
  
usleep(1000000/$bandwidth);
}
// UploadBandwidthLimitHack 

This might help, but isn't a good solution IMHO.

Milhouse 01-12-2004 07:00 PM

hmm nope I was still able to download at higher then 30k/s with that. It just took forever for the download to start that's all. Anyother solutiosn anyone ?

Milhouse 01-12-2004 07:06 PM

oh and BTW at the end of the file i have echo $attachmentinfo[filedata]; not what you posted above

Andreas 01-12-2004 07:38 PM

Hmm ... what version do you use?
This is for RC2 and worked for me.

Milhouse 01-12-2004 07:45 PM

Running vb 2.3.2 Did I post in the wrong section ?

Milhouse 01-12-2004 07:51 PM

Also i do have a vb3 RC2 forum runnign where i just tried that and it was a no go as well.

Andreas 01-12-2004 07:58 PM

Strange, does work for me. Well then - sorry for the mess.

NTLDR 01-12-2004 08:03 PM

Quickly looking at the code I'd assume it works for images only.

Milhouse 01-12-2004 08:52 PM

Quote:

Originally Posted by NTLDR
Quickly looking at the code I'd assume it works for images only.


That's what i assumed as well.

Which is not good for me. i need ti to essentially effect all attachements.

Any ideas from the gurus here?


All times are GMT. The time now is 08:40 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.01238 seconds
  • Memory Usage 1,737KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete