Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-23422

Windows: Submission of files/images is broken on Windows 8.1 & Windows 10

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Release 5.4.0
    • Component/s: Windows
    • Environment:

      Ti SDK: 5.3.0.v20160509143032
      Building for Windows, iOS & Android

    • Story Points:
      8
    • Sprint:
      2016 Sprint 11 SDK

      Description

      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...

      Test Case

      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();
      
      

      Discussions

      Expect windows to perform as iOS & Android do.

        Attachments

          Activity

            People

            • Assignee:
              cwilliams Christopher Williams
              Reporter:
              kdclaw3@gmail.com Dee Clawson
              Reviewer:
              Kota Iguchi
            • Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-9765
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Source Code