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?
Printable View
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?
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.
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
thanks !!! it solved my problem
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".