Skip to content

Commit 407798b

Browse files
authored
POST a multipart form only when the page may upload a file (#896)
1 parent c99237a commit 407798b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

flow/src/org/labkey/flow/controllers/executescript/importAnalysis.jsp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@
4444
ImportAnalysisForm form = (ImportAnalysisForm)getModelBean();
4545
Container container = getContainer();
4646
ActionURL cancelUrl = urlProvider(ProjectUrls.class).getStartURL(container);
47+
// we are only posting files for the first step of the wizard
48+
String enctype = form.getStep() > AnalysisScriptController.ImportAnalysisStep.SELECT_ANALYSIS.getNumber()
49+
? "application/x-www-form-urlencoded"
50+
: "multipart/form-data";
4751
%>
4852
<script type="text/javascript" nonce="<%=getScriptNonce()%>">
4953
function endsWith(a,b)
@@ -85,7 +89,7 @@
8589

8690
<labkey:errors/>
8791

88-
<labkey:form name="<%=ImportAnalysisForm.NAME%>" action="<%=new ActionURL(AnalysisScriptController.ImportAnalysisAction.class, container)%>" method="POST" enctype="multipart/form-data">
92+
<labkey:form name="<%=ImportAnalysisForm.NAME%>" action="<%=new ActionURL(AnalysisScriptController.ImportAnalysisAction.class, container)%>" method="POST" enctype="<%=enctype%>">
8993
<input type="hidden" name="step" value="<%=form.getStep()%>">
9094
<%
9195
for (Map.Entry<String, String> entry : form.getWorkspace().getHiddenFields(getViewContext()).entrySet())

0 commit comments

Comments
 (0)