Uploadbeschränkung für Dateigröße in ASP.NET MVC: mehr als 1 maxRequestLength-Einstellung in web.config (s)
Ich hätte gerne mehr als 1 Einstellung für maxRequestLength - Upload-Beschränkung für Dateigröße (z. B. eine für Datei / Neu, andere für Bild / Neu). Alle meine Aktionen erfordern zusätzliche Parameter (z. B. / File / New? FolderId = 234).
Einzelne Einstellung funktioniert wie erwartet:
<code><httpRuntime executionTimeout="60" maxRequestLength="1024" /> </code>
Ich habe versucht, 2 Einstellungen mit 2 Speicherortabschnitten in der root-Datei web.config zu haben, aber ohne Erfolg. Ich bin nicht sicher, was ich in "Pfad" schreiben soll - physische Aspx-Seite einer Ansicht oder Controller + Aktion ... jedoch scheint nichts zu funktionieren.
<code><location path="/File/"> <system.web> <httpRuntime executionTimeout="60" maxRequestLength="4096" /> </system.web> </location> <location path="/Picture/"> <system.web> <httpRuntime executionTimeout="60" maxRequestLength="1024" /> </system.web> </location> </code>
Ich habe versucht, eine andere web.config in einem bestimmten Ansichtsordner abzulegen (z. B. / Views / Picture / ...), wie es in klassischem Webform ASP.NET funktioniert, aber dies scheint auch nicht der Trick zu sein ...
<code><location path=""> <system.web> <httpRuntime executionTimeout="60" maxRequestLength="1024" /> </system.web> </location> </code>
Egal was ich tue, nur ein Wert für httpRuntime.maxRequestLength wird angewendet - der in (root) web.config ... system.web.