473,385 Members | 1,907 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Bandwidth/Download Limit

Hello,

I'd like to make some download speed limitation on some of my files
using PHP. I know that an Apache module can do that, but i cannot access
my ISP Apache configuration.

My idea was to put the file into a .htaccess protected diretory and to
build a "proxy" with PHP.

I can also put a download limit (after n download per day the script
deny download). Any idea or known script doing that?

Thank you in advance,

Nicolas

Jul 17 '05 #1
1 9510
Nicolas C. <cuicui.NO-SPAM.@noos.fr> wrote:
I'd like to make some download speed limitation on some of my files
using PHP. I know that an Apache module can do that, but i cannot access
my ISP Apache configuration.

My idea was to put the file into a .htaccess protected diretory and to
build a "proxy" with PHP.


Perfectly possible. Keep the files in a protected area, create an array
with locations and call a php script with an array index to get the
file. Read the file in a buffer (eg 4k) and sleep 1 sec, my simple logic
says that the browser will get a max transfer of 4kb/s in this example:

$fp=fopen($file,'r')
while(!feof($fp))
{
echo fgets($fp,4096);
sleep(1);
}
fclose($fp);

BTW don't forget to set an appropriate mimetype, and do extensive
errorcatching.

--

Daniel Tryba

Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Samir | last post by:
Hello, I have a website that is hosted by another company. Is there some kind of php script to limit downloading to a certain amount size? And is there kind thing I can do to the .htaccess...
0
by: blizzard | last post by:
Hi, Sorry if this question has already been posted: How can I limit the bandwidth incoming from or outgoing to a socket to a specific byterate? I mean exactly like the WinMX options "limit in/out...
0
by: Martin Raychev | last post by:
Hi everybody, I have a need for a web app that will allow a flash client to download files at a specified speed. I am using Flash for an application of mine which downloads JPG slides to...
2
by: hoenes1 | last post by:
Hi all, I have an asp.net application from which registered users can download files. What I want to implement is a bandwidth restriction for certain users. What I DON'T want to do is restrict...
9
by: Chibi | last post by:
I'm writing an application that's bandwidth intense. My available bandwidth is 1.5Mbps (cable modem) and I know I can reach around 1.4Mbps, if not more. The application I am writing right now...
0
by: z.c | last post by:
Hi Guys, i'am on a Mission but i'am stuck, usually you can help me out. I'am trying to write a C# Application that can Limit the Network Bandwidth (In- and Out-going) per Process just like...
0
by: Rex Winn | last post by:
Hi all I am looking for code/articles that can show me how to implement bandwidth throttling on a local machine using C/C++. The reason being is that I have users on Satellite Internet that if...
8
by: FrobinRobin | last post by:
Hi, I intend to use Ajax for a kiosk application, it's primary usage is to retrieve live data from my DB, it's a fairly small amount of data (5 fields, of small data size and limited to 15...
4
by: salman | last post by:
Hello I am developing a server and I want to view and change the the clients TCP connection bandwidth. Please help me Salman Ali
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.