Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: UploadFile

  1. #1
    Sencha User
    Join Date
    Oct 2010
    Location
    India
    Posts
    84
    Vote Rating
    0
      0  

    Default UploadFile

    How to upload file using EXTJS ?
    I am using Action class on the backend to upload file..Can anyone help how to deal with it ?

  2. #2
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    119
      1  

    Default

    1. Put a FileUploadField on your form.
    2. Configure your form with fileUpload:true.
    3. Configure your server so it can handle multi-part uploads.

  3. #3
    Sencha User
    Join Date
    Oct 2010
    Location
    India
    Posts
    84
    Vote Rating
    0
      0  

    Default

    I'm applying fileUpload:true property to form but it is giving systax error and i am not able to fetch the whole path of the file.
    Here is my code.

    Ext.onReady(function(){

    var uploadfile=new Ext.form.FileUploadField(
    {
    name: 'FilePath',
    emptyText: 'Select File',
    fieldLabel: 'Upload File',
    width:200,
    buttonText: 'Browse'
    });

    var uploadForm=new Ext.FormPanel({
    name:'uploadForm',
    id:'uploadForm',
    fileUpload:true,

    renderTo: document.body,
    title:'Upload Form',
    autoHeight:true,
    width:400,
    items:[uploadfile],
    buttons: [{
    text: 'Save',
    handler: function(){
    uploadForm.getForm().submit({url: 'UploadFile.action'});

    }
    }]
    });


    });

  4. #4
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    119
      1  

    Default

    Syntax error where?

    ps. Some browsers don't allow access to the file path - Nothing you can do about that.

  5. #5
    Sencha User
    Join Date
    Oct 2010
    Location
    India
    Posts
    84
    Vote Rating
    0
      0  

    Default

    uploadForm.getForm().submit({url: 'UploadFile.action'});

    in this statement..

  6. #6
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    119
      0  

    Default

    And what is the error?

  7. #7
    Sencha User
    Join Date
    Oct 2010
    Location
    India
    Posts
    84
    Vote Rating
    0
      0  

    Default

    Syntax error ()

  8. #8
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    119
      0  

    Default

    A bit more information please!

    Which line number in ext-all-debug.js or other file (and which Ext version number)?

  9. #9
    Sencha User
    Join Date
    Oct 2010
    Location
    India
    Posts
    84
    Vote Rating
    0
      0  

    Default

    Error is on linenumber 7389 in ext-all-debug.js and m using ext3.2.1 version.

  10. #10
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    119
      1  

    Default

    Line 7389 is in the middle of the Date parsing code! You are not using dates in this example, so that makes no sense what soever!

Page 1 of 2 12 LastLast

Similar Threads

  1. change uploadfile button
    By albaba1903 in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 20 Jan 2010, 8:15 PM
  2. A simple Form with uploadFile field inside!?
    By Dariusz in forum Ext 2.x: Help & Discussion
    Replies: 17
    Last Post: 16 Nov 2007, 4:57 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •