웹에서이 라인을 추가 .Config 파일.
일반적인 파일 업로드 크기는 4MB입니다. 여기에 KB로 언급 된 system.web
maxRequestLength
및 system.webServer
maxAllowedContentLength
에서와 같이 Bytes.
<system.web>
.
.
.
<httpRuntime executionTimeout="3600" maxRequestLength="102400" useFullyQualifiedRedirectUrl="false" delayNotificationTimeout="60"/>
</system.web>
<system.webServer>
.
.
.
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="1024000000" />
<fileExtensions allowUnlisted="true"></fileExtensions>
</requestFiltering>
</security>
</system.webServer>
당신은 web.config
에 언급 된 maxFile
업로드 크기는 모든 의견을 .cs
페이지에
System.Configuration.Configuration config = WebConfigurationManager.OpenWebConfiguration("~");
HttpRuntimeSection section = config.GetSection("system.web/httpRuntime") as HttpRuntimeSection;
//get Max upload size in MB
double maxFileSize = Math.Round(section.MaxRequestLength/1024.0, 1);
//get File size in MB
double fileSize = (FU_ReplyMail.PostedFile.ContentLength/1024)/1024.0;
if (fileSize > 25.0)
{
ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "Alert", "alert('File Size Exceeded than 25 MB.');", true);
return;
}
감사 주어진 줄을 사용 알고 싶다면. 제안 된 솔루션 중 일부를 시도한 후에 Teleriks RAD 업로드 구성 요소를 사용하여 결국 내가 필요한 것을 수행 할 수있었습니다. – Cragly
이것은 Silverlight 또는 Flash로 수행 할 수 있습니다. Falsh에게는 [swfupload] (http://www.swfupload.org/)가 있습니다. –
swfupload는 무료이며 좋습니다. 여러 번 사용했고 실제로 질문에 답합니다. 여기 +1. –