[CLOSED] [#92] FileUpload

  1. #1

    [CLOSED] [#92] FileUpload

    Hello,

    Anyway to make a FileUpload field not clear it's selected file out after upload? I'm returning an error message over direct event, and once the error message is received the user has to select the file for upload again to correct it.

    Any suggestions?

    Cheers,
    Timothy
    Last edited by Daniil; Jan 15, 2013 at 4:00 AM. Reason: [CLOSED]
  2. #2
    Ooops, edited the wrong post.
  3. #3
    Hi Timothy,

    You can override this behavior by the following way.

    Example
    <ext:ResourcePlaceHolder runat="server" Mode="ScriptFiles" />
    
    <script type="text/javascript">
        Ext.form.field.File.override({
            extractFileInput: function() {
                var fileInput = this.fileInputEl.dom;
                //this.reset();
                return fileInput;
            }
        });
    </script>
    But you will have to call the reset method yourself to let a user to choose a new file.
  4. #4
    I've started the related thread on Sencha.
    http://www.sencha.com/forum/showthread.php?202912
  5. #5
    Sencha says they have an opened ticket for this case. I will monitor.
    http://www.sencha.com/forum/showthread.php?239572
  6. #6
    Opened an Issue to track this defect, see:
    https://github.com/extnet/Ext.NET/issues/92
  7. #7
    Added the ClearOnSubmit property for FileUploadField (trunk, v2.2).

    Thank you again for the report.
    Last edited by Daniil; Jan 15, 2013 at 4:03 AM.
  8. #8
    I know this has been fixed in 4.2.

    I just wanted to say that, for those still on Ext.net 2.1.1/ ExtJs 4.1.1, the patch provided in this thread leads to another weird behavior. The file name is not cleared but after you submit, clicking on the button to select another file doesn't do anything, it doesn't open the file dialog.

    For now, I will just live with the field being reset.
  9. #9
    Thank you for the update!

    Probably, it is why ExtJS team decided to reset a file field and then restore.

Similar Threads

  1. [CLOSED] [MVC] FileUpload in MVC
    By UnifyEducation in forum 2.x Legacy Premium Help
    Replies: 6
    Last Post: Jan 27, 2015, 4:03 PM
  2. [1.3] Is bug for fileupload in PropertyGrid?
    By tms2003@126.com in forum 1.x Help
    Replies: 1
    Last Post: Apr 25, 2012, 9:52 AM
  3. Ext.Net fileupload field
    By akwolf in forum 1.x Help
    Replies: 5
    Last Post: Jan 03, 2012, 11:39 PM
  4. Replies: 0
    Last Post: Feb 24, 2010, 10:09 PM
  5. bug in fileupload
    By pablisho in forum 1.x Help
    Replies: 0
    Last Post: Jul 01, 2009, 10:55 AM

Posting Permissions