kostysh / File-uploading-component-for-Sencha-Touch

Ext.Button based component for uploading files in Sencha Touch apps without page refresh
51 stars 26 forks source link

Choose another type of file #6

Closed andersonef closed 11 years ago

andersonef commented 11 years ago

In first place, congratulations for this component, I like it very much, very simple to use. Well, I tested it on my android and it works well for images and videos, but my project needs the user upload a JSON file. Can you help me? Thanks.

kostysh commented 11 years ago

Why not? JSON file is a kind of TXT file. Or you want load file locally and use it as object? It is possible. You should override (or rewrite) "doLoad" method. Inside this method you should use "readAsText" instead of "readAsDataURL" and then Ext.decode(yourFileTextContent)

andersonef commented 11 years ago

I'm developing an application to tablet. The box of choosing file works well in the browser, but on tablet, look how it looks. Screenshot_2013-03-15-13-35-31 1

kostysh commented 11 years ago

this situation depends on device (some vendors allow and some not). On some devices you can choose file from file system.

andersonef commented 11 years ago

Understand... Do you know if there's a way, some param I can send to phonegap that I can choose another type of file?

kostysh commented 11 years ago

Phonegap has own API to filesystem http://docs.phonegap.com/en/2.5.0/cordova_file_file.md.html#File You can use this API instead of FileReader

andersonef commented 11 years ago

I think I'll need use this instead your component =( But thank you very much for your help. Congratulations for your great job ^^

kostysh commented 11 years ago

not instead of my component - you can modify the component. Fileup.js - line 384 you should use here Phonegap API instead of FileReader (HTML5 API)

andersonef commented 11 years ago

Understand... I'll try here.. Thanks ^^