Reputation: 165
As the subject says, we have IIS restriction to file size that we have extended to allow uploading a files up to 50MB. But in particular situation we have to send larger files as .zip/.rar. We want to achieve this without extending IIS file size limit.
We think to make something like splitting the archive file into smaller files and then combine them again on the server, but this is the very first idea.
I'm curios if there are any examples for this or any built in mechanism to do that. Of course any other suggestions from more experienced people are truly welcome.
Thank you in advance!
Best Regards, Ivan Ivanov
Upvotes: 0
Views: 1031
Reputation: 1610
I know this isn't your ideal solution, but instead of changing the entirety of IIS' file size limit, why not just do it for one specific location?
in your web.config file you want to add something like this:
<location path="logon.aspx">
<system.web>
<httpRuntime requestValidationMode="2.0" executionTimeout="960" maxRequestLength="1073741824" /><!--1GB-->
</system.web>
</location>
1073741824 represents 1GB (approximately). The maxRequestLength is in bytes. The executionTimeout is in seconds. See here for more information on those: http://msdn.microsoft.com/en-us/library/vstudio/e1f13641(v=vs.100).aspx
More information on <location>
: http://msdn.microsoft.com/en-us/library/vstudio/b6x6shw7(v=vs.100).aspx
That's how I would go about doing that, hopefully this helps Or you find the proper answer you are looking for.
Upvotes: 0
Reputation: 1039358
We think to make something like splitting the archive file into smaller files and then combine them again on the server, but this is the very first idea.
Actually that's a great idea. There are no built-in mechanisms for this in .NET but here are some pointers to get you started:
Upvotes: 2
Reputation: 905
Maybe you can store the files database as binary. Not a perfect solution but it's one of the solutions.
More info here: Saving any file to in the database, just convert it to a byte array?
Upvotes: 0