Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

Kako da povecam dozvoljenu velicinu fajla za upload

[es] :: .NET :: ASP.NET :: Kako da povecam dozvoljenu velicinu fajla za upload

[ Pregleda: 1693 | Odgovora: 1 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

pl4stik
Senior .NET programmer/Consultant
oDesk
NI na nebu NI na zemlji

Član broj: 173596
Poruke: 715
82.117.195.*

Sajt: xx-auth.com.azhar.arvixe...


+31 Profil

icon Kako da povecam dozvoljenu velicinu fajla za upload06.10.2008. u 07:23 - pre 189 meseci
jer ako je fajl preko 4Mb vrati mi praznu stranu bez ex-a !? Koristim standardnu upload kontrolu u VS 2005 (C#)
Negde sam procitao da se to podesava u machine configu al ne znam gde mi je taj text pa ako neko ima resenje pri ruci .. Hvala unapred
To sto nekoliko miliona ljudi tvrdi da nisi u pravu ne znaci da stvarno nisi - Frank Zappa

https://youtu.be/DLe358DPGXU
 
Odgovor na temu

pl4stik
Senior .NET programmer/Consultant
oDesk
NI na nebu NI na zemlji

Član broj: 173596
Poruke: 715
82.117.195.*

Sajt: xx-auth.com.azhar.arvixe...


+31 Profil

icon Re: Kako da povecam dozvoljenu velicinu fajla za upload06.10.2008. u 11:25 - pre 189 meseci
Working Around File Size Limitations

You may not realize it, but there is a limit to the size of a file that can be uploaded using this technique. By default, the maximum size of a file to be uploaded to the server using the FileUpload control is around 4MB. You cannot upload anything that is larger than this limit.
One of the great things about .NET, however, is that it usually provides a way around limitations. You can usually change the default settings that are in place. To change this size limit, you make some changes in either the web.config.comments (found in the ASP.NET 2.0 configuration folder at C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG) or your application's web.config file.
In the web.config.comments file, find a node called <httpRuntime> that looks like the following:
<httpRuntime
executionTimeout="110"
maxRequestLength="4096"
requestLengthDiskThreshold="80"
useFullyQualifiedRedirectUrl="false"
minFreeThreads="8"
minLocalRequestFreeThreads="4"
appRequestQueueLimit="5000"
enableKernelOutputCache="true"
enableVersionHeader="true"
requireRootedSaveAsPath="true"
enable="true"
shutdownTimeout="90"
delayNotificationTimeout="5"
waitChangeNotification="0"
maxWaitChangeNotification="0"
enableHeaderChecking="true"
sendCacheControlHeader="true"
apartmentThreading="false" />
A lot is going on in this single node, but the setting that takes care of the size of the files to be uploaded is the maxRequestLength attribute. By default, this is set to 4096 kilobytes (KB). Simply change this value to increase the size of the files that you can upload to the server. If you want to allow 10 megabyte (MB) files to be uploaded to the server, set the maxRequestLength value to 11264, meaning that the application allows files that are up to 11000 KB to be uploaded to the server.
Making this change in the web.config.comments file applies this setting to all the applications that are on the server. If you want to apply this to only the application you are working with, apply this node to the web.config file of your application, overriding any setting that is in the web.config.comments file. Make sure this node resides between the <system.web> nodes in the configuration file.
Another setting involved in the size limitation of files to be uploaded is the value given to the executionTimeout attribute in the <httpRuntime> node.
The value given the executionTimeout attribute is the number of seconds the upload is allowed to occur before being shut down by ASP.NET. If you are going to allow large files to be uploaded to the server, you are also going to want to increase this value along with the maxRequestLength value.
One negative with increasing the size of a file that can be uploaded is that there are hackers out there who attack servers by throwing a large number of requests at them. To guard against this, you can actually decrease the size of the files that are allowed to be uploaded; otherwise, you may find hundreds or even thousands of 10 MB requests hitting your server.

Source MSDN





To sto nekoliko miliona ljudi tvrdi da nisi u pravu ne znaci da stvarno nisi - Frank Zappa

https://youtu.be/DLe358DPGXU
 
Odgovor na temu

[es] :: .NET :: ASP.NET :: Kako da povecam dozvoljenu velicinu fajla za upload

[ Pregleda: 1693 | Odgovora: 1 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.