iis 7 WebDav upload file size limit -only 50 KBRSS

19 replies

Last post Sep 25, 2017 08:01 PM by dtotzke

  • iis 7 WebDav upload file size limit -only 50 KB

    Dec 23, 2008 05:10 AM|now_acc01|LINK

    I've install WebDav into IIS7 - works fine over ssl ! :) 

    Download - is ok - 5 MB, 50 MB etc.

    Upload - ONLY 50KB! how to change this limit?

    I can not modify setting this on client (could be in regedit)

     

    How to change it on IIS 7?

  • Re: iis 7 WebDav upload file size limit -only 50 KB

    Dec 23, 2008 04:35 PM|JaroDunajsky|LINK

    Have you by any chance edited the request limits? Specifically the maxAllowedContentLength setting? It's default value is 30,000,000.

    You could dump request filtering settings for the "Default Web Site" by running
    %windir%\system32\inetsrv\appcmd.exe list config "Default Web Site" -section:system.webServer/security/requestFiltering  /config:*

    (adjust the name of the site to fit your environment). Check the maxAllowedContentLength value.

    To change the value to let's say 50,000,000 you could run
    %windir%\system32\inetsrv\appcmd
    .exe set config "Default Web Site" -section:system.webServer/security/requestFiltering /requestLimits.maxAllowedContentLength:"50000000" /commit:apphost

     

    Jaroslav Dunajsky (MSFT, IIS)
  • Re: iis 7 WebDav upload file size limit -only 50 KB

    Dec 26, 2008 08:18 AM|now.acc|LINK

    i've executed commands... still the same - only 50 KB. :(

     

  • Re: iis 7 WebDav upload file size limit -only 50 KB

    Dec 29, 2008 04:32 AM|Leo Tang - MSFT|LINK

    Hi,

    I’d suggest you use Configuration Editor in IIS Administration Pack to change the maxAllowedContentLength on the WebDAV site and test again.
    Administration Pack for IIS 7.0
    http://www.iis.net/extensions/AdministrationPack

    After installation is finished, you could check the RequestLimits setting by the following steps:
    1.Run inetmgr to open IIS Manager
    2.Expand your server/sites, and choose your website
    3.Double-Click the “Configuration Editor” in the group named “Management” on the right panel
    4.Choose the section  “system.webServer/security/requestFiltering”

    Please mark the replies as answers if they help or unmark if not.
    Feedback to us


  • Re: iis 7 WebDav upload file size limit -only 50 KB

    May 21, 2009 06:50 AM|cooljules|LINK

    I also have this problem, but have some more information that might help fix it. The fix you suggested sadly doesn't work.

    I have a 2008 server and vista, both have the same issue.

    I can upload files of any size I like with the asp component ASPupload. This shows it is not a file limit problem as such, but I think it is a different kind of security issue.

    Can anyone spot what is in this code which might cause IIS7 to block anything over 50k?

    <!--#include file="upload.asp" -->
    <%sPath="C:\inetpub\wwwroot"
    Set oUploader = New FileUploader
    oUploader.Upload()
    %>

     

    Upload.asp File:

    <%
    '***************************************
    ' File:   Upload.asp
    ' Author: Jacob "Beezle" Gilley
    ' Email:  avis7@airmail.net
    ' Date:   12/07/2000
    ' Comments: The code for the Upload, CByteString,
    '   CWideString subroutines was originally
    '   written by Philippe Collignon...or so
    '   he claims. Also, I am not responsible
    '   for any ill effects this script may
    '   cause and provide this script "AS IS".
    '   Enjoy!
    '           Modded by Chris for extra features
    '****************************************

    Class FileUploader
     Public  Files
     Public FormReq

     Private Sub Class_Initialize()
      Set Files = Server.CreateObject("Scripting.Dictionary")
      Set FormReq = Server.CreateObject("Scripting.Dictionary")
     End Sub
     
     Private Sub Class_Terminate()
      If IsObject(Files) Then
       Files.RemoveAll()
       Set Files = Nothing
      End If
      If IsObject(FormReq) Then
       FormReq.RemoveAll()
       Set FormReq = Nothing
      End If
     End Sub

     Public Default Sub Upload()
      Dim biData, sInputName
      Dim nPosBegin, nPosEnd, nPos, vDataBounds, nDataBoundPos
      Dim nPosFile, nPosBound

      biData = Request.BinaryRead(Request.TotalBytes)
      nPosBegin = 1
      nPosEnd = InstrB(nPosBegin, biData, CByteString(Chr(13)))
      
      If (nPosEnd-nPosBegin) <= 0 Then Exit Sub
      
      vDataBounds = MidB(biData, nPosBegin, nPosEnd-nPosBegin)
      nDataBoundPos = InstrB(1, biData, vDataBounds)
      
      Do Until nDataBoundPos = InstrB(biData, vDataBounds & CByteString("--"))
       
       nPos = InstrB(nDataBoundPos, biData, CByteString("Content-Disposition"))
       nPos = InstrB(nPos, biData, CByteString("name="))
       nPosBegin = nPos + 6
       nPosEnd = InstrB(nPosBegin, biData, CByteString(Chr(34)))
       sInputName = CWideString(MidB(biData, nPosBegin, nPosEnd-nPosBegin))
       nPosFile = InstrB(nDataBoundPos, biData, CByteString("filename="))
       nPosBound = InstrB(nPosEnd, biData, vDataBounds)
       
       If nPosFile <> 0 And  nPosFile < nPosBound Then
        Dim oUploadFile, sFileName
        Set oUploadFile = New UploadedFile
        
        nPosBegin = nPosFile + 10
        nPosEnd =  InstrB(nPosBegin, biData, CByteString(Chr(34)))
        sFileName = CWideString(MidB(biData, nPosBegin, nPosEnd-nPosBegin))
        oUploadFile.FileName = Right(sFileName, Len(sFileName)-InStrRev(sFileName, "\"))

        nPos = InstrB(nPosEnd, biData, CByteString("Content-Type:"))
        nPosBegin = nPos + 14
        nPosEnd = InstrB(nPosBegin, biData, CByteString(Chr(13)))
        
        oUploadFile.ContentType = CWideString(MidB(biData, nPosBegin, nPosEnd-nPosBegin))
        
        nPosBegin = nPosEnd+4
        nPosEnd = InstrB(nPosBegin, biData, vDataBounds) - 2
        oUploadFile.FileData = MidB(biData, nPosBegin, nPosEnd-nPosBegin)
        
        If oUploadFile.FileSize > 0 Then Files.Add LCase(sInputName), oUploadFile
       Else
        nPos = InstrB(nPos, biData, CByteString(Chr(13)))
        nPosBegin = nPos + 4
        nPosEnd = InstrB(nPosBegin, biData, vDataBounds) - 2
        If Not FormReq.Exists(LCase(sInputName)) Then FormReq.Add LCase(sInputName), CWideString(MidB(biData, nPosBegin, nPosEnd-nPosBegin))
       End If

       nDataBoundPos = InstrB(nDataBoundPos + LenB(vDataBounds), biData, vDataBounds)
      Loop
     End Sub

     'String to byte string conversion
     Private Function CByteString(sString)
      Dim nIndex
      For nIndex = 1 to Len(sString)
         CByteString = CByteString & ChrB(AscB(Mid(sString,nIndex,1)))
      Next
     End Function

     'Byte string to string conversion
     Private Function CWideString(bsString)
      Dim nIndex
      CWideString =""
      For nIndex = 1 to LenB(bsString)
         CWideString = CWideString & Chr(AscB(MidB(bsString,nIndex,1)))
      Next
     End Function
    End Class

    Class UploadedFile
     Public ContentType
     Public FileName
     Public FileData
     
     Public Property Get FileSize()
      FileSize = LenB(FileData)
     End Property

     Public Sub SaveToDiskAs(sPath,sFile)
      Dim oFS, oFile
      Dim nIndex
     
      If sPath = "" Or sFile = "" Then Exit Sub
      If Mid(sPath, Len(sPath)) <> "\" Then sPath = sPath & "\"
     
      Set oFS = Server.CreateObject("Scripting.FileSystemObject")
      If Not oFS.FolderExists(sPath) Then Exit Sub
      
      Set oFile = oFS.CreateTextFile(sPath & sFile, True)
      
      For nIndex = 1 to LenB(FileData)
          oFile.Write Chr(AscB(MidB(FileData,nIndex,1)))
      Next

      oFile.Close
     End Sub

     Public Sub SaveToDisk(sPath)
     
      Call SaveToDiskAs(sPath,Filename)
     
     End Sub
     
     Public Sub SaveToDatabase(ByRef oField)
      If LenB(FileData) = 0 Then Exit Sub
      
      If IsObject(oField) Then
       oField.AppendChunk FileData
      End If
     End Sub

    End Class
    %>

  • Re: iis 7 WebDav upload file size limit -only 50 KB

    Jun 15, 2009 08:48 AM|ratbalas|LINK

    Hi,

     

    I am also facing the same problem. <httpRuntime maxRequestLength="100000" /> aded under <system.web> doesn't go beyond 29MB. but it is for 100MB

    Regards

    B. Rathinakumar 

     

  • Re: iis 7 WebDav upload file size limit -only 50 KB

    Jun 16, 2009 12:57 AM|ratbalas|LINK

    Adjusting File Size Limit in IIS 7

    The problem is that in IIS 7 on Windows 2008 Server, the web application will reject any file that is larger than 30 MB. This is a default limitation of IIS. You can increase the maximum file size by adding the following code to <system.webServer> in the web.config file:

    <security>
     <requestFiltering>
      <requestLimits maxAllowedContentLength=”2000000000″ />
     </requestFiltering>
    </security>

     

    The above solved the problem

     

    Regards

    B. Rathinakumar

    rathinakumarb@gmail.com

  • Re: iis 7 WebDav upload file size limit -only 50 KB

    Oct 05, 2009 04:28 PM|iteuss|LINK

    Did anyone of you fixed this problem? I have the same problem: only 60K and no more. I changed but still nothing changes. Any ideas?
  • Re: iis 7 WebDav upload file size limit -only 50 KB

    Jan 24, 2010 04:25 PM|ragrone|LINK

    I am having the same issues.. I updated the entire server to 1 gig, and then the individual web site to match and I am still failing.... I have my timeouts at 5 minutes as well...  There is something really, really wrong with IIS 7.0 this really sucks because I need to have people sending in videos to upload at least a 500 meg file even if they have to send up files in "chunks"  Is there a fix Microsoft, YES or NO.. I would hate like heck to have to switch to Linux because no one can get this problem straightened out
  • Re: iis 7 WebDav upload file size limit -only 50 KB

    Jan 26, 2010 11:23 AM|rathinakumarb|LINK

    This will work surely. Check your session time out also

     for 500mb the value should be ...

    <system.webServer> in the web.config file:

    <security>
     <requestFiltering>
      <requestLimits maxAllowedContentLength=”500000000000″ />
     </requestFiltering>
    </security>

    Regards

    B. Rathinakumar

    rathinakumarb@gmail.com

  • Re: iis 7 WebDav upload file size limit -only 50 KB

    Nov 28, 2010 11:51 PM|brucewf|LINK

    Have the same upload issue at about 50KB. Server 2008, IIS7 with WebDav.

    The requestLimits maxAllowedcontentLength is well above this setting but even if I change that value this does not chnage the 50Kb point.

    mmmmm

    cheers Bruce.

     

    Serverr 2008 _IIS7 Webdav configuration

  • Re: iis 7 WebDav upload file size limit -only 50 KB

    Feb 15, 2011 11:45 AM|vorotech|LINK

    I have the same problem. I also need to mention that this happens only when using HTTPS connection (WCF, basicHttpBinding, streamed mode).

    I found a little trick. Unfortunately, it cannot help in the end scenarios.

    I get the same error (413) when I'm trying to upload file greater than 50 kb.
    If previously upload some small file (in my scenario it was 25 kb size), suddenly all big files (greater than 50 kb) uploads normally without any errors.

    I want to know why it is so happens and how to configure IIS7 to work without any stupid tricks.

     PS: I tried to specify all configurations sections listed in this thread.

    Now I have next:

    <httpRuntime maxRequestLength="536871" executionTimeout="3600" />
    This values is in the KBs.
    <security>
    <requestFiltering>
    <requestLimits maxAllowedContentLength="536870912"/>
    </requestFiltering>
    </security>
    <binding name="basicHttpBindingCfg" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" maxBufferSize="65536" maxReceivedMessageSize="536870912" transferMode="Streamed">
    <security mode="Transport">
    <transport>
    <extendedProtectionPolicy policyEnforcement="Never" />
    </transport>
    </security>
    </binding>
  • Re: iis 7 WebDav upload file size limit -only 50 KB

    Mar 01, 2011 08:53 AM|vorotech|LINK

    Guys, it started to worf for me after I restarted IIS.

  • Re: iis 7 WebDav upload file size limit -only 50 KB

    Dec 09, 2011 06:08 AM|Rumbly|LINK

    If your problem is with Classic ASP the answer is different. Open IIS Manager, click your web site, click on ASP under IIS, open Limits Properties, set Maximum Requesting Entity Body Limit to desired figure ... job done :0)

  • Re: iis 7 WebDav upload file size limit -only 50 KB

    Dec 20, 2011 04:42 AM|steven2011|LINK

    I have the same issue as "vorotech" in the above posts.

    HTTPS requests over 64 KB are failing with error 400 Bad Request using the REST client in Firefox to test.

    I have added the above code to my web.config file and updated the value for Maximum Requesting Entity Body Limit in the Limit Properties box in ASP.  Restarted IIS, same issue.

    Requests over 64 KB using the HTTP protocol is OK.

    Any help would be appreciated.

  • Re: iis 7 WebDav upload file size limit -only 50 KB

    Jan 24, 2012 11:30 AM|WebDAV|LINK

    Any chance to upload a file over 2Gb in one piece? I need to upload files of at least 10Gb, otherwise IIS is not an option for me. As far as I understand 2Gb (some people say 4Gb in Classic mode) is the IIS ans ASP.NET limitation, is it fixed in IIS 8 / ASP.NET 4.5?

    2Gb limit IIS7 upload IIS8 WebDAV

  • Re: iis 7 WebDav upload file size limit -only 50 KB

    May 09, 2012 05:17 AM|dlatikay|LINK

    this solved my case. no IIS restart required. thanks for sharing!

    it took me a while to find what is "ASP under IIS": you have to select the server node (=computer name), there and only there you'll find this "ASP" icon, it is not configurable on a per-site basis.

  • Re: iis 7 WebDav upload file size limit -only 50 KB

    Sep 13, 2012 03:27 AM|3aMarco|LINK

    This works for me !

    2 things to do:

    1. <div mce_keep="true">As Rumbly said:
      "Open IIS Manager, click your web site, click on ASP under IIS, open Limits Properties, set Maximum Requesting Entity Body Limit to desired figure"</div>
    2. <div mce_keep="true"> As rathinakumarb  said:
       Change in the web.config requestLimits maxAllowedContentLength</div>

    IIS7 asp classic upload limit

  • Re: iis 7 WebDav upload file size limit -only 50 KB

    Oct 01, 2016 04:03 PM|Florisz|LINK

    @Leo Tang - MSFT thank you for your reply. This brought me to the solution although I could not use the exact steps you suggest because Windows Server 2012 R2 Essentials will throw an error that IIS can not edit/save the web.config of the default website. I looked at the web.config file security and the only role/user that has full(edit) control is the TrustedInstaller. So even administrators have only read access.

    Then I found the option 'Request filtering' under the IIS section so NOT in the Configuration editor. After double click on the 'Request filtering' there is an option on the right hand side with 'Edit feature settings...'. If you click on this a popup will open where you can change the 30Mb(30000000) to a max of 4294967295 bytes.

    See screenshot below

  • Re: iis 7 WebDav upload file size limit -only 50 KB

    Sep 25, 2017 08:01 PM|dtotzke|LINK

    Thanks Leo Tang.  Almost 10 years later and this solved my problem.  I knew what I had to do, I just couldn't find where to do it.  Thanks!