Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Limiting file download size. Anyone?

Status
Not open for further replies.

Terrinha

IS-IT--Management
May 27, 2002
7
PT
Well, i know this is a tricky question, and i have searched google for days, and i cant find anything to help me. Maybe theres someone here that can give me a hand ..

What i whant to do, is to limit the max file size a user can download from my apache webserver. For exemple, limit to 5Mb. If a file is larger than 5Mb, then nobody can download the file, cause the server would not allowit. If the file is smaller, then the file would be downloaded sucessfully.

How in the world can i do this? It is even possible?

Thank you for your time.
 
Hi mate,

I don't think this would be possible for a few reasons. Even if you could prevent a browser downloading over 5MB, what about programs that support resume? Surely cancelling and resuming would allow a larger download.

Hope this helps

Wullie

Fresh Look - Quality Coldfusion Hosting

The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
 
It seems the best solution is: avoid to place such huge files in a server contents tree. Nobody can access them - why these files are on a web-server?..
 
Well, that an idea, however, i can i controll the users to the point to not allow them to upload large files?

Im starting to think that theres nothing that can be done to prevent apache from serving files over 5mb ( or any other configurable size ) ..
 
ArkM has given the same answer that I would. I don't understand what you're trying to accomplish....

Are you saying that individual users are putting large files within apache's directories for others to download? And this is what you're trying to prevent?
 
Ok, I took it that the files were there, you just didn't want them to be downloadable.

If you are wanting to limit the size of files on the server, you would be best to run a script every so often to check for files over 5MB and delete them.

Hope this helps

Wullie

Fresh Look - Quality Coldfusion Hosting

The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
 
Thats whats im gonna do .. Use a script..
 
As far as I know, LimitRequestBody directive solves the problems with evil users uploads:

If, for example, you are permitting file upload to a particular location, and wish to limit the size of the uploaded file to 100K, you might use the following directive:

LimitRequestBody 102400
Apache 2.0 Manual
 
Changing the value of LimitRequestBody will require a server recompile though.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top