View Full Version : [CLOSED] FileUploadFile cleared right after submit

Jan 15, 2013, 12:54 AM
Sample to reproduce below. Select a file then hit save. The content of the FileUploadField textbox is cleared and the empty text is shown. Am I missing something?

I tested with the latest SVN trunk as of right now and I also reproduced the problem in Ext.net 2.1.1.

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html>

<head id="Head1" runat="server">
<title>FormPanel - Ext.NET Examples</title>
<link href="/resources/css/examples.css" rel="stylesheet" />

#fi-button-msg {
border: 2px solid #ccc;
padding: 5px 10px;
background: #eee;
margin: 5px;
float: left;

<ext:ResourceManager ID="ResourceManager1" runat="server" />
<form id="Form1" runat="server">

<h2>Form Example</h2>

<p>The FileUploadField can also be used in standard form layouts, with support for anchoring, validation (the
field is required in this example), empty text, etc.</p>

Title="File Upload Form"
PaddingSummary="10px 10px 0 10px"
<ext:Parameter Name="anchor" Value="95%" Mode="Value" />
<ext:Parameter Name="allowBlank" Value="false" Mode="Raw" />
<ext:Parameter Name="msgTarget" Value="side" Mode="Value" />
EmptyText="Select an image"

<ext:Button ID="SaveButton" runat="server" Text="Save" >
<Click Handler="#{BasicForm}.getForm().submit();">
<ext:Button ID="Button2" runat="server" Text="Reset">
<Click Handler="#{BasicForm}.getForm().reset();" />

Jan 15, 2013, 1:58 AM
After debugging more, it seems that the problem is in this source, ext-4.1.1a\src\form\field\File.js, the call to the field reset().

extractFileInput: function() {
var fileInput = this.fileInputEl.dom;
return fileInput;

I created this bug:

Jan 15, 2013, 4:03 AM
Hi @bogc,

I reported it earlier.

Here is a related Ext.NET forum thread.

Your post led us to know that they already added the clearOnSubmit option. Thank you.

We added a respective server property for FileUploadField (trunk).

Jan 15, 2013, 4:42 AM
Thank you, Daniil.

Just as a side note I searched both forums (sencha and ext.net) for an issue related - I thought I can't be the first one finding this, and I was right :-) - but I couldn't find anything so I decided to create the bug report. I searched for: FileUploadField clear. The other thread that you mentioned didn't come up because it didn't contain FileUploadField. I often use the Search Forum feature which I think it is not as good as the google search. For instance google might decide to search substrings and infer cleared->clear or the other way.

Thanks again

Jan 15, 2013, 5:05 AM
First of all, it is totally not a problem that you posted it. It even gave as a real benefit - we knew that the clearOnSubmit option appeared.

It is a common case for me when I reports duplicates to Sencha forums. Recently, I even reported a duplicate of my own report:)

I often use the Search Forum feature which I think it is not as good as the google search.

Please notice that Google search is available for Ext.NET forums. The "Search" box at the top on the right.

Jan 15, 2013, 5:17 AM
Is there a way to search only the Ext.Net 2.x posts using the google search you suggested?

Jan 15, 2013, 5:58 AM
I don't know such an option. I am afraid there is no.