Results 1 to 2 of 2

Thread: File Upload Problem

  1. #1
    Sencha Premium Member
    Join Date
    Jan 2013
    Vote Rating

    Default File Upload Problem


    I am in new sencha touch developer. when i am try to file upload by this below code

    <link rel="stylesheet" href="resources/css/sencha-touch.css" type="text/css">
    <script type="text/javascript" src="resources/sencha-touch-debug-w-comments.js"></script>

    app.views.addphoto.Form = Ext.extend(Ext.form.FormPanel, {
    height: 457,
    width: 279,
    initComponent: function () {
    Ext.regModel('Contact', {
    fields: ['silver', 'cover', 'delete']
    var store = new{
    model: 'Contact',
    sorters: 'delete',
    getGroupString: function (record) {
    return record.get('delete')[0];
    data: [{
    silver: 'silver.png',
    cover: 'hyphen.png',
    delete: 'delete.png'
    }, {
    silver: 'horse.png',
    cover: 'ok.png',
    delete: 'delete.png'
    }, {
    silver: 'silver.png',
    cover: 'hyphen.png',
    delete: 'delete.png'
    /*Ext.apply(app.views, {
    myhorseFieldset: new app.views.myhorse.Fieldset()
    Ext.apply(this, {
    id: 'formid',
    defaultType: 'textfield',
    fileUpload: true,
    method: 'post',
    frame: true,
    isUpload: true,
    items: [{
    xtype: 'panel',
    margin: '20 0 0 0',
    title: 'Add Horses',
    id: 'titlealign',
    centered: 'true',
    cls: 'addhorse',
    items: [{
    docked: 'top',
    xtype: 'toolbar',
    title: 'Add Horses',
    ui: 'light',
    html: '<div style="float:right; padding-top:8px;"><img src="resources/images/dots2s.png" ></div>',
    cls: 'addhorse',
    }, {
    xtype: 'container',
    flex: 2,
    padding: '0 auto',
    html: '<img src="resources/images/silver.png" width="114" height="114" />',
    }, {
    fieldLabel: 'Upload',
    id: 'uploadid',
    xtype: 'textfield',
    name: 'file',
    inputType: 'file',
    allowBlank: false,
    disabled: false,
    xtype: 'button',
    html: '+&nbsp;&nbsp;PHOTO',
    margin:'0 0 0 83px;',
    padding:'0 10px',
    handler: function () {
    //window.location = '#addhorse';
    xtype: 'panel',
    flex: 2,
    html: '<hr>',
    margin: '0 auto',
    padding: '0 15px'
    }, {
    xtype: 'panel',
    flex: 2,
    ui: 'light',
    id: 'photopanel',
    html: '<div><span class="name" >Name</span> <span class="cover">Cover</span> <span class="delete">Delete</span></div>',
    hideOnMaskTap: true,
    centered: true,
    hideOnMaskTap: true,
    width: '15em',
    height: '8em',
    scroll: 'vertical',
    xtype: "list",
    itemTpl: '<div><span class="imgfile">{silver}</span> <span class="covercheck"> <img src="resources/images/{cover}" /></span> <span class="deletefile"><img src="resources/images/{delete}"/></span></div>',
    ui: 'none',
    style: 'background:none',
    grouped: false,
    indexBar: false,
    store: store
    }, {
    xtype: 'button',
    text: 'Next',
    scope: this,
    handler: function (b, e) {
    //var form = Ext.getCmp('formid');
    var form = Ext.getCmp("formid");
    url: app.config.url.horseUploadResponse,
    method: 'POST',
    success: function (frm, res) {
    alert('Form submitted: ' + res.success);
    failure: function (frm, res) {
    alert('Form no submit!');
    app.views.addphoto.Form.superclass.initComponent.apply(this, arguments);
    render: function () {
    app.views.addphoto.Form.superclass.render.apply(this, arguments);

    Please can someone help for me.

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Gainesville, FL
    Vote Rating


    You say you are a new Sencha Touch developer but are posting in Ext JS 3 Help forum. Which are you using?
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2

    Think my support is good? Get more personalized support via a support subscription.

    Need more help with your app? Hire Sencha Services

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Posting Permissions

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