RickStrahl / Westwind.plUploadHandler

An ASP.NET base HttpHandler library to handle plUpload content on the server.
28 stars 19 forks source link

Need to check for MaxUploadSize > 0 #1

Closed rdogmartin closed 11 years ago

rdogmartin commented 11 years ago

I included your handler in the beta of Gallery Server Pro I just released as it was better than the one I wrote. A user just reported an issue where a "file too large" message is sent to the user when MaxUploadSize = 0 (unlimited).

In line 93 of plUploadBaseHandler.cs you have:

if (chunk == 0 && Request.ContentLength * (chunks - 1) > MaxUploadSize)

I think it needs a check for when MaxUploadSize > 0:

if (chunk == 0 && MaxUploadSize > 0 && Request.ContentLength * (chunks - 1) > MaxUploadSize)

Cheers, Roger

RickStrahl commented 11 years ago

Hi Roger,

Thanks good catch. Fixed…

Aloha,

+++ Rick ---

Rick Strahl

West Wind Technologies

http://www.west-wind.com/ www.west-wind.com

http://www.west-wind.com/weblog http://www.west-wind.com/weblog

http://twitter.com/RickStrahl http://twitter.com/RickStrahl

From: rdogmartin [mailto:notifications@github.com] Sent: Thursday, March 28, 2013 3:39 AM To: RickStrahl/Westwind.plUploadHandler Subject: [Westwind.plUploadHandler] Need to check for MaxUploadSize > 0 (#1)

I included your handler in the beta of Gallery Server Pro I just released as it was better than the one I wrote. A user just reported an issue where a "file too large" message is sent to the user when MaxUploadSize = 0 (unlimited).

In line 93 of plUploadBaseHandler.cs you have:

if (chunk == 0 && Request.ContentLength * (chunks - 1) > MaxUploadSize)

I think it needs a check for when MaxUploadSize > 0:

if (chunk == 0 && MaxUploadSize > 0 && Request.ContentLength * (chunks - 1) > MaxUploadSize)

Cheers, Roger

— Reply to this email directly or view it on GitHub https://github.com/RickStrahl/Westwind.plUploadHandler/issues/1 . https://github.com/notifications/beacon/eaA61VQ_OgJRG1835Ec7gTAOEaykFkcX6ohWh7v0JtatUJIUg7EdmR8wd9ebo9p2.gif