小编m4c*_*ine的帖子

超过IIS 7.5和.NET中的2GB文件上载限制

我有一个内部网应用程序,需要上传(.iso)超过2GB的文件.看来2GB文件大小有很多限制因素.

  1. IE中存在浏览器限制,只有IE 9/10可以超过2GB.根据Eric Law的说法
  2. httpRuntimemaxRequestLength元素的类型为Int32,其最大值为2097151,大约为2GB.

看来你可以设置另一个文件大小限制,其中maxAllowedContentLength大约为4GB,因为它的类型是uint,但是当我们仍然受到maxRequestLength的2GB限制时会有什么好处呢?

<system.webServer>
  <security>
    <requestFiltering>
      <requestLimits maxAllowedContentLength="4294967295" />
    </requestFiltering>
  </security>
<system.webServer>
Run Code Online (Sandbox Code Playgroud)

有没有人有任何上传超过2GB限制的文件的解决方案?

asp.net iis file-upload

8
推荐指数
1
解决办法
8677
查看次数

Inline Datepicker的不显眼验证不起作用,适用于非内联Datepicker

我没有使用jquery.ui的datepicker,因为我需要在不同条件下选择整周和多个日期,所以我在EditorTemplate中使用Keith Wood的 datepicker作为我的Date字段:

    @model Nullable<DateTime>
    @{
        string name = ViewData.TemplateInfo.HtmlFieldPrefix;
        string id = name.Replace(".", "_");
        string dt = Model.HasValue ? String.Format("{0:d}",(string)Model.Value.ToShortDateString()) : string.Empty;
    }        
    @Html.TextBox("", dt, new { @class = "datefield", @type = "date", @id = id })
    <script type="text/javascript">
        $(document).ready(function () {
            $('#@id').datepick({
                renderer: $.datepick.themeRollerRenderer,
                multiSelect: 999
            });
        });    
    </script>
Run Code Online (Sandbox Code Playgroud)

使用文本框并使用日期选择器"弹出"时,验证工作正常; 但我真正想要的是使用内联日期选择器,但我无法在这些条件下进行验证:

    @model Nullable<DateTime>
    @{
        string name = ViewData.TemplateInfo.HtmlFieldPrefix;
        string id = name.Replace(".", "_");
        string dt = Model.HasValue ? String.Format("{0:d}",(string)Model.Value.ToShortDateString()) : string.Empty;
    }

    <div class="kwdp">
    </div>
    @Html.Hidden("", dt, …
Run Code Online (Sandbox Code Playgroud)

asp.net-mvc jquery jquery-validate data-annotations unobtrusive-validation

5
推荐指数
1
解决办法
5301
查看次数