选择一个3gb的文件,提交动作触发器,超过3gb的提交动作不再工作
本文关键字:提交 3gb 触发器 工作 不再 超过 文件 一个 选择 | 更新日期: 2023-09-27 17:53:42
真的很困惑,为什么这个不工作…
我有一个输入和一个按钮,我用它来获取文件路径,以便稍后处理一些工作。我遇到的问题是,如果我选择一个~3gb的文件,我的提交操作就像预期的那样工作。如果我选择一个~4gb或~5gb的文件,我的提交动作就不再起作用了。没有东西会返回到服务器。我不做上传。我只是使用选定的文件路径。知道是怎么回事吗?这是使用IE。
更新:这在Chrome中工作,但因为我不能得到正确的路径我的功能失败。
文件选择代码:
public CmtMediaUiGenerator<TModel> video(
Expression<Func<TModel, MediaFileViewModel>> fileExpression,
Expression<Func<TModel, bool>> widescreenExpression,
Expression<Func<TModel, int?>> formatExpression,
Expression<Func<TModel, bool>> encryptedExpression = null,
bool stacked = false,
object htmlAttributes = null)
{
string id = Guid.NewGuid().ToString("n");
MvcHtmlString label = HtmlHelper.LabelFor(fileExpression, htmlAttributes: new { @class = "label" });
//MvcHtmlString id = HtmlHelper.IdFor(expression);
StringBuilder validationMessages = new StringBuilder();
validationMessages.Append(HtmlHelper.ValidationMessageFor(fileExpression).ToHtmlString());
validationMessages.Append(HtmlHelper.ValidationMessageFor(widescreenExpression).ToHtmlString());
validationMessages.Append(HtmlHelper.ValidationMessageFor(formatExpression).ToHtmlString());
StringBuilder html = new StringBuilder();
html.AppendFormat("<div class='"video-container'" id='"{0}'">", id);
html.Append("<div class='"video-file-container'">");
string fileId = HtmlHelper.IdFor(fileExpression).ToHtmlString();
MediaFileViewModel fileValue = fileExpression.Compile().Invoke(Model);
html.AppendFormat("<input type='"hidden'" id='"{0}.FilePath'" name='"{0}.FilePath'" value='"{2}'" />"
+ "<input type='"hidden'" id='"{0}.MediaFileId'" name='"{0}.MediaFileId'" value='"{3}'" />"
+ "<button id='"{0}-button'" class='"button button-small'">Select File</button>"
+ "<span id='"{0}-value'" class='"display-value file-name-display'">{1}</span>",
fileId,
(fileValue == null ? null : Path.GetFileName(fileValue.FilePath)),
(fileValue == null ? null : fileValue.FilePath),
(fileValue == null ? 0 : fileValue.MediaFileId));
html.Append("</div>");
html.Append("<div>");
string widescreenId = HtmlHelper.IdFor(widescreenExpression).ToHtmlString();
bool widescreenValue = widescreenExpression.Compile().Invoke(Model);
html.AppendFormat("<div class='"checkbox-value'">"
+ "<input type='"checkbox'" id='"{0}'" name='"{0}'" value='"true'" disabled {1} />"
+ "<label for='"{0}'">Widescreen</label>"
+ "</div>",
widescreenId, (widescreenValue ? "checked" : ""));
string formatId = HtmlHelper.IdFor(formatExpression).ToHtmlString();
int? formatValue = formatExpression.Compile().Invoke(Model);
html.AppendFormat("<input type='"hidden'" id='"{0}'" name='"{0}'" value='"{1}'" />"
+ "<div class='"label'">Format:</div><span id='"{0}-value'" class='"format-value'">{2}</span>",
formatId, formatValue,
(formatValue == null ? "n/a" : string.Format("MPEG {0}", formatValue)));
string encryptedId = (encryptedExpression == null ? null
: HtmlHelper.IdFor(encryptedExpression).ToHtmlString());
if (encryptedExpression != null)
{
bool encryptedValue = encryptedExpression.Compile().Invoke(Model);
html.AppendFormat("<div class='"checkbox-value'">"
+ "<input type='"checkbox'" id='"{0}'" name='"{0}'" value='"true'" disabled {1} />"
+ "<label for='"{0}'">Encrypted</label>"
+ "</div>",
encryptedId, (encryptedValue ? "checked" : ""));
validationMessages.Append(HtmlHelper.ValidationMessageFor(encryptedExpression).ToHtmlString());
}
html.Append("</div>");
html.AppendFormat("<script>$(function() {{ setUpVideoUpload('{0}', '{1}', '{2}', '{3}', {4}); }});</script>",
id,
fileId,
widescreenId,
formatId,
(encryptedId == null ? "null" : "'" + encryptedId + "'"));
html.Append("</div>");
GenerateEditItemSet(id, label.ToHtmlString(), html.ToString(), validationMessages.ToString(),
stacked: stacked,
valueCssClass: "file-value");
return (this);
//new string[] { "1", "2", "4" }
}
提交:public CmtMediaUiGenerator<TModel> saveCancelButtons()
{
Output.Append("<hr />"
+ "<p>"
+ "<a href='"/Media/'" class='"button'">Cancel</a>"
+ "<input type='"submit'" name='"PostAction'" value='"Save'" class='"button button-primary'" />"
+ "<input type='"submit'" name='"PostAction'" value='"Save & Close'" class='"button button-primary'" />"
+ "</p>");
return (this);
}
提前感谢!
这就是我的问题的答案
http://blogs.msdn.com/b/ieinternals/archive/2011/03/10/wininet-internet-explorer-file-download-and-upload-maximum-size-limits.aspx