Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Blackberry file upload

$
0
0

HI all,

I am using the below code to upload the file to server , in BB10

This code is working for iPhone and android , not in BB10

var win = Ti.UI.createWindow({
    backgroundColor:'#FFFFFF'
});
 
var packageFile = 'test.txt';
var file =  Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, "KS_nav_ui.png");
 
if (file.exists) {
    Titanium.API.info('file read value-----' +file.read());
   blackberryupload(file.read());
}
 
function blackberryupload(filedata)
{
            var X = Ti.Network.createHTTPClient({
 
            });
 
            var ext = '';
 
            X.setTimeout(99000);
 
            url_media_sub = 'http://demoserver.tacme.net:3030/AlameenMobileImageUpload/ImageUploaderService.asmx/UploadImage';
 
            X.open('POST', url_media_sub);
 
            X.onload = function() { alert('service response'+ this.responseText);
 
 
            };
            X.onsendstream = function(e) {
                //ind.value = e.progress ;
                //Ti.API.info('ONSENDSTREAM - PROGRESS: ' + e.progress);
            };
 
            X.onerror = function() {
             alert('service error'+ this.responseText);
 
            };
            X.setRequestHeader("enctype", "multipart/form-data");
            X.setRequestHeader('Cache-Control', 'no-cache');
            var params = {
 
                media : filedata,
 
                image_name : 'test.png'
 
            };
            X.send(params);
}
is there any separate method to upload for blackberry, i searched in forum but couldn't find any solution…

i am looking forward a positive response from you guys…

Thanks in advance……..


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>