XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 3.2.0
    • None
    • None

    Description

      Filetransfer download and upload are not working in Blackberry10 (Z10) phone

      we have used below api for image upload

      From capture api we are taking fileuri

      var options = new FileUploadOptions();
      options.fileKey="images[0]";
      options.fileName=fileURI.substr(fileURI.lastIndexOf('/')+1);
      options.mimeType="image/jpeg";

      ft.upload(imageURI, serverURI, win, fail, options)

      It is not working.

      Even download image from server also not working

      Normal filetransfer.download not working. So we have tried below code that is also not working

      window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem;
      var xhr = new XMLHttpRequest();
      console.log("uri = "+uri);
      xhr.open('GET', uri, true);
      xhr.responseType = 'blob';

      xhr.onload = function(e) {
      console.log("xhr onload funcation e"+e);
      window.requestFileSystem(PERSISTENT, 1024 * 1024 * 10, function(fs) {
      console.log("fs = "+fs);
      fs.root.getFile('/accounts/1000/shared/downloads/image.jpg',

      {create: true}

      , function(fileEntry) {
      console.log("file entry"+fileEntry);
      fileEntry.createWriter(function(writer) {
      console.log("writer created");
      writer.onwrite = function(e)

      { console.log("writer on write = "+e.toString()); }

      ;
      writer.onerror = function(e)

      { console.log("writer on error = "+e); }

      ;
      console.log("resp = "+xhr.response);
      var blob = new Blob([xhr.response],

      {type: 'image/jpg'}

      );
      console.log("blob size is := "+blob.size);
      writer.write(blob);

      }, onError);
      }, onError);
      }, onError);
      };

      xhr.send();

      Actually image.jpg file is created under '/accounts/1000/shared/downloads/' folder but not writing the blob cobntent into the file

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              vijaya Vijaya Lakshmi
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: