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.
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?
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".