1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    15
    Vote Rating
    1
    rhonnel francisco is on a distinguished road

      0  

    Default Unanswered: Uploading image to a remote server

    Unanswered: Uploading image to a remote server


    Hi guys, i dont understand why this sample project fails when i ran it into a device or simulator. I'm using cordova 1.8.0 and my device is iPhone 4S

    See this example: http://mindsaur.com/demo/fileupload/

    Source: https://github.com/kostysh/File-uplo...r-Sencha-Touch

    That example works perfectly in the browser but when i install it on the device everytime i capture or select a photo the screen becomes black and the app is not responding anymore, any idea??

    I badly need this kind of function on my app.

  2. #2
    Sencha - Services Team AndreaCammarata's Avatar
    Join Date
    Jun 2009
    Posts
    1,395
    Answers
    148
    Vote Rating
    23
    AndreaCammarata has a spectacular aura about AndreaCammarata has a spectacular aura about

      0  

    Default


    Could you please post me only the code where you ask PhoneGap to take a picture?
    I'm pretty sure you are facing a performance issue because you are asking to get a High quality picture in a base64 format instead of using the FILE_URI destination type.
    Sencha Inc
    Andrea Cammarata, Solutions Engineer
    Owner at SIMACS

    @AndreaCammarata
    www.andreacammarata.com
    github: https://github.com/AndreaCammarata

    TUX components bundle for Sencha Touch 2.x.x
    https://github.com/AndreaCammarata/TUX


  3. #3
    Sencha User
    Join Date
    Sep 2013
    Posts
    5
    Vote Rating
    0
    ram.pekam is on a distinguished road

      0  

    Default Image Upload using Base64

    Image Upload using Base64


    I am trying to upload image to JAVAServer, Following are the details :

    I am using server : JAVA Spring with REST Services and Extjs 4.

    I need to upload image using base64 to Server.

    1. What are the best practices for uploading image to server ?

    2. How to convert image to base64 string in extjs4 ?

    3. How to submit form along with form data ?

    With this I am able to hit server but every parameter is null i.e. no data is being transferred
    var form = Ext.getCmp('member_form').getForm();


    if (form.isValid()) // Validation
    {
    // communicating with server for registering member info
    form.submit({
    url : '/my/Test',
    // standardSubmit: true,
    method : 'POST',
    waitMsg : 'Registring...',
    success : function(form, o) {
    console.log(form);
    msg('Success', 'Processed file "'
    + o.result.file
    + '" on the server');
    },
    failure : function() {
    alert('Registration failed...');
    }
    });
    }

    Please help me I am stucked at this point.

  4. #4
    Sencha User
    Join Date
    May 2011
    Location
    Melbourne, Australia
    Posts
    89
    Answers
    5
    Vote Rating
    7
    Greg Arnott is on a distinguished road

      0  

    Default


    Code:
     
    initialize: function() {
            this.callParent();
    
    
            var me     = this,
                fileup = Ext.create('Ext.ux.Fileup', {
                    itemId        : 'fileLoadBtn',
                    xtype         : 'fileupload',
                    autoUpload    : true,
                    loadAsDataUrl : true,
                    cls           : 'icon-cameraroll',
                    states: {
                        browse: {
                            text: 'Browse and load'
                        },
                        ready: {
                            text: 'Load'
                        },
                        uploading: {
                            text: 'Loading',
                            loading: true
                        }
                    }
                });
    
    
            me.insert(2, fileup);
    
    
            fileup.show();
    
    
            fileup.on('loadsuccess', me.onFileLoadSuccess, me);
            fileup.on('loadfailure', me.onFileLoadFailure, me);
        },
    
    
        onFileLoadFailure: function(message) {
            Ext.Viewport.down('#imageUploadMessage').setHtml(message);
        },
    
    
        onFileLoadSuccess: function(dataurl, reader, e) {
            // dataurl = the image in base64 format.
        }