0

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

ivan.ice
  • 155
  • 1
  • 7
  • The file size limit is there for a reason I suppose. So circumventing it may be described as 'hacking' :) My first thought was as yours though: recombining file chunks on the other side in some form or another – ne1410s Sep 23 '14 at 20:20
  • Yes, I know that what we are trying to do is a little bit hacky but these are the requirements :) – ivan.ice Sep 24 '14 at 08:50

3 Answers3

2

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:

Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928
0

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?

Community
  • 1
  • 1
ErTR
  • 863
  • 1
  • 14
  • 37
  • We don't have dedicated database.Our services use something like blob storage for persisting some data. But thank you for the reference it was interesting :) – ivan.ice Sep 24 '14 at 08:58
0

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.

Termato
  • 1,556
  • 1
  • 16
  • 33