1. #1
    Sencha User
    Join Date
    Jul 2011
    Posts
    2
    Vote Rating
    0
    augustwing is on a distinguished road

      0  

    Default image upload

    image upload


    i am new to sencha touch . i am trying to upload an image file to the server . can you give me idea on how to proceed on it?

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,604
    Vote Rating
    818
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    At it's current state, mobile phones cannot upload files like you can on a computer. The only way to do it is with something like PhoneGap that can access the local filesystem.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    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.

  3. #3
    Sencha User
    Join Date
    Aug 2010
    Posts
    303
    Vote Rating
    3
    steve1964 is on a distinguished road

      0  

    Default


    Hi, you can use the Phonegap filetransfer (from local device to a server), you also need a server side script (php, asp, etc.) to upload the file:
    http://docs.phonegap.com/phonegap_fi...l#FileTransfer

  4. #4
    Sencha User
    Join Date
    Jul 2011
    Posts
    2
    Vote Rating
    0
    augustwing is on a distinguished road

      0  

    Default


    thanks !!! it solved my problem

  5. #5
    Sencha User
    Join Date
    Nov 2009
    Posts
    2
    Vote Rating
    0
    bigssam is on a distinguished road

      0  

    Default Requesting some ideas

    Requesting some ideas


    Quote Originally Posted by augustwing View Post
    thanks !!! it solved my problem

    I m trying to make an upload file with sencha touch for an iOS webAPP, and I m asking you to describe me your solution.

    Regards

  6. #6
    Sencha User
    Join Date
    Sep 2012
    Posts
    104
    Vote Rating
    0
    rbahumi is on a distinguished road

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    At it's current state, mobile phones cannot upload files like you can on a computer. The only way to do it is with something like PhoneGap that can access the local filesystem.
    Is this answer still relevant to the latest Sencha 2.x version?

  7. #7
    Sencha User
    Join Date
    Jul 2011
    Posts
    4
    Vote Rating
    0
    gmz is on a distinguished road

      0  

    Default


    Yes, mobile phones can upload photos / other files. Simple html <input type="file"> is processed by:

    -> Android: works on all versions. Usually you can choose from photo/video/music library.
    -> iOS: up to iOS 5 it way not supported (mobile Safari made intupt type="file" disabled). But from now, with iOS 6, it works. On new iPhone/iPad's clicking file input gives you list with two options: choose an existing photo or make a photo.

    In sencha 1.x this is the way to do this:
    {
    xtype: 'textfield',
    inputType: 'file',
    ...
    },

    But - you cannon get file data into JavaScript code (security reasons), and the only way to proceed is to submit a form, then file is uploaded to server. You need to do some dig into dom elements, because it is not supported by sencha 1.x, but it's possible. (i don't know how about sencha 2.x)

    If you did't do this kind of things, google about "file upload using hidden iframe".