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

We can upload multiple medias to server?

$
0
0

I'm trying to upload an array of images but it don't upload any images of my array... someone knows how to upload multiple medias?

var imgs = []
 
imgs.push( Ti.Filesystem.tempDirectory, "img1.png" );
imgs.push( Ti.Filesystem.tempDirectory, "img2.png" );
imgs.push( Ti.Filesystem.tempDirectory, "img3.png" );
imgs.push( Ti.Filesystem.tempDirectory, "img4.png" );
 
xhr = Ti.Network.createHTTPClient();
 
xhr.onload = function(e){
    Ti.API.info( 'Success' );
};
 
xhr.error = function(e){
    Ti.API.info( "Error" );
};
 
xhr.onsendstream = function(e){
    Ti.API.info( "ONSENDSTREAM - PROGRESS: " + e.progress )
};
 
xhr.setRequestHeader( "Content-Type", "multipart/form-data" );
xhr.open( 'POST', 'myServerURL' );
 
xhr.send({
    "media" : imgs      // This don't work!
    //"media" : imgs[0]  -- THIS WORK
});

Viewing all articles
Browse latest Browse all 8068

Trending Articles



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