Stopping a large upload from continuing - WeOnlyDo Discussion board

Stopping a large upload from continuing (wodWebServer / wodWebServer.NET)

by Simon, Wednesday, June 03, 2009, 15:41 (5433 days ago)

Hi there,

I am trying to stop users from uploading a large file.
I can disconnect them before they upload it using the following code in the RequestHeaders event:
Dim sf As String = e.user.Request.Headers( Content-Length ).Value

But, rather than disconnecting the user, I want to redirect the user to an error page (or output some sort of message) without them continuing with the upload. How can this be done?

Re: Stopping a large upload from continuing

by woddrazen, Wednesday, June 03, 2009, 15:57 (5433 days ago) @ Simon

Hi Simon,


You can send some status code to your client using WebResponse object StatusCode Property.

Something like this:[code]User.Response.StatusCode = Forbidden[/code]
More help for StatusCode Property (with list of status you can send to user) you can find here
http://www.weonlydo.com/WebServer/Help/WODWEBSERVERLib~WebResponse~StatusCode.html

Let us know how it goes.


Regards,
Drazen

Re: Stopping a large upload from continuing

by wodcg, Wednesday, June 10, 2009, 00:30 (5427 days ago) @ woddrazen

Hmm... I was hoping there was a more user friendly way of doing it, but ok.