Responnse redirect from global.asax
bonjour tout le monde
je veux faire un contrôle sur la taille des fichiers à charger
bien sur la taille des fichiers sera fixée dans web.config http runtime maxRequestLength
je veux traiter le cas de fichier volumineux dans le fichier global .asax
voila le code
Code:
1 2 3 4 5 6 7 8 9 10 11
|
Dim g As String
Dim ex1 As HttpException = TryCast(Server.GetLastError().GetBaseException(), HttpException)
If ex1 IsNot Nothing AndAlso ex1.ErrorCode = -2147467259 Then
Dim oConfigSection As System.Web.Configuration.HttpRuntimeSection = DirectCast(ConfigurationManager.GetSection("system.web/httpRuntime"), System.Web.Configuration.HttpRuntimeSection)
If Request.ContentLength > oConfigSection.MaxRequestLength * 1000 Then
Server.ClearError()
Response.Redirect("default.aspx")
End If
End If |
mon problème est que la connexion sera réinitialisé sans que sache pourquoi
sachiez vous la réponse et est ce que vous avez des solutions à mon problème?
merci