PDA

View Full Version : image upload



augustwing
29 Jul 2011, 2:39 AM
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?

mitchellsimoens
29 Jul 2011, 5:10 AM
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.

steve1964
29 Jul 2011, 9:32 AM
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_file_file.md.html#FileTransfer

augustwing
2 Sep 2011, 9:40 AM
thanks !!! it solved my problem

bigssam
10 Feb 2012, 2:09 AM
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

rbahumi
28 Oct 2012, 9:15 AM
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?

gmz
5 Nov 2012, 10:37 AM
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".