Project: titanium
Issue TIMOB-23422: Windows: Submission of files/images is broken on Windows 8.1 & Windows 10
h2. Problem When using Ti.Network.createHTTPclient to submit files Windows sends non-nonsensical repeating combination of "%00%00%00%00%00%00%00%00%00%" for the file instead of blob/base64 file. Other values appear to be corrupted as well. iOS & Android perform as expected and submit a parse-able muli-part form data. This issue is stopping us from going live on windows... h2. Test Case {code:lang=javascript|title=app.js} var url = 'https://wul06jzgd0yn.runscope.net'; //use favorite inspector here... function go() { Titanium.Media.showCamera({ mediaTypes: [Ti.Media.MEDIA_TYPE_PHOTO], success: function(event) { if (event.mediaType == Ti.Media.MEDIA_TYPE_PHOTO) { var newId = new Date().getTime(); var newName = 'HEY_YOU_GUYS_WAIT_FOR_ME-' + newId; var fileName = newName + '.jpg'; var imageFile = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, fileName); imageFile.write(event.media); console.log(imageFile.nativePath); var client = Ti.Network.createHTTPClient({ onload: function(e) { alert('success'); }, onerror: function(err) { alert('error'); } }); client.open("POST", url); var f = { name: newName, attachment: imageFile.read(imageFile) }; client.send(f); } }, cancel: function() { console.log('camera cancel'); }, error: function(error) { console.log('camera error'); } }); } go(); {code} h2. Discussions Expect windows to perform as iOS & Android do.
Story points: 8