by
Roland Schumacher alias GENiALi
27. Mai 2009 -- 141
words -- 1 mal gelesen
I screw at the time an application rum that one allows to upload files. They are then stored in a SQL Server.
By default, ASP.NET limits the size 4 MB (4096 KB). Can be changed with this entry here.
[...]
< system.web > <!-customize upload size. Is approximately 4 MB in KB (4 MB 4096KB)--= >) < httpRuntime maxRequestLength = "8192" / > [...]
It therefore also makes sense that it informs the user about the maximum size of the file. I will also show how big a file may be. I wanna have customize but whenever the value of the HTML. So, it must be possible in the code.
For example to:
Configuration config = WebConfigurationManager.OpenWebConfiguration("~");
HttpRuntimeSection section config.GetSection("system.web/httpRuntime") = as HttpRuntimeSection; double maxFileSize = Math.Round(section.MaxRequestLength_/_1024.0,_1);
("{labFileSize.Text string.Format("{0:0.# =} MB ", maxFileSize);
When it comes more easily let me know.
79e4646b-bee3-4f7a-9c05-3fbfe3e3f5f6|0|.0
Tags: