When uploading a file through asp.net is there any way to intercept the upload befor the file is beeing saved by my asp.net code? This is im working on is an upload page. People have a certain amount of quota to upload to. If they upload large files and quota
is expired the file is first uploded, i dont know where to but i supose to a temp directory set by the webserver, then when its done they get a message saying that the uploaded file was not saved due to insufficient space. Thats a problem cause the file is
first uploaded then they get a message that it wasnt saved. I want to intercept the upload before the file is uploaded to the webserver. Is there any way to accompish this?? Any ideas is very welcome.
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim MaxLength As Integer = 50000 ' 50Kb
If Request.Files(0).ContentLength > MaxLength Then
Response.Write("")
Response.End()
End If
'Continue to upload/save file ...
End Sub
hugo bendeli...
Member
10 Points
2 Posts
Intercept an upload
Oct 08, 2003 05:12 PM|LINK
rox.scott
Contributor
6080 Points
1214 Posts
Re: Intercept an upload
Oct 09, 2003 03:19 PM|LINK
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim MaxLength As Integer = 50000 ' 50Kb If Request.Files(0).ContentLength > MaxLength Then Response.Write("") Response.End() End If 'Continue to upload/save file ... End Sub