Cordova Filetransfer always gives error 3 in simulator

7 posts, 0 answers
  1. Jonas
    Jonas avatar
    33 posts
    Member since:
    Sep 2009

    Posted 24 Feb 2014 Link to this post

    When I use the Filetransfer upload function from within the ios simulator I always get an "error 3" file transfer error. Would be cool to be able to try use that function in the simulator aswell.

    My code works fine when run on phone.

            var options = new FileUploadOptions();
            options.fileKey = "file";
            options.fileName = fileURI.substr(fileURI.lastIndexOf('/') + 1);
            options.mimeType = "image/jpeg";
            options.params = {}; // if we need to send parameters to the server request
            options.headers = {
                Connection: "close"
            };
            options.chunkedMode = false;

            var ft = new FileTransfer();

            ft.upload(fileURI, encodeURI(fileUrl), successFn, failFn, options);
  2. Jonas
    Jonas avatar
    33 posts
    Member since:
    Sep 2009

    Posted 25 Feb 2014 in reply to Jonas Link to this post

    According to this http://www.telerik.com/forums/access-local-storage#iv6zGVoRBEaOf4aBgih94g cordova plugins does not work in the simulator. Ok, good to know, but is this something that will be included in a (not so far) future?
  3. Nadya
    Admin
    Nadya avatar
    4 posts

    Posted 26 Feb 2014 Link to this post

    Hello Jonas,

    Thank you for reporting this issue. Your Telerik points has been updated.

    In our last release we have added support for the Apache Cordova FileTransfer core plugin in the device simulator but you have came across a bug in the functionality. The bug is logged and will be addressed for future releases.

    The problem is in setting http headers. In order to have your sample working in the simulator, remove the "Connection: close", when declaring the headers:

    options.headers = {};


    Regards,
    Nadya
    Telerik
    Icenium is now Telerik AppBuilder, and is part of the Telerik Platform. For more information on the new name, and to learn more about the Platform, register for the free online keynote and webinar on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT)
  4. Odin
    Odin avatar
    3 posts
    Member since:
    Apr 2014

    Posted 11 Dec 2014 Link to this post

    Are there any news about adding support for the headers in options?
  5. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 16 Dec 2014 Link to this post

    Hi Odin,

    This issue is already addressed and you shouldn't have any issues adding headers in a FileTransfer upload request. You can check our sample app utilizing this functionality.

    Regards,
    Tina Stancheva
    Telerik
     

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

     
  6. nermeen
    nermeen avatar
    1 posts
    Member since:
    May 2016

    Posted 24 May Link to this post

    I use the the Filetransfer upload function in my mobile app and after building for IOS and testing it on different IPhone devices, it is working fine in most IPhone devices but in IPhone 6 plus and 4s get error code 3 and when opening the setting of the my app on the iPhone I found that the app can access the camera and image but doesn't have permissions to access WIFI

    can you help me please

  7. Garo
    Admin
    Garo avatar
    46 posts

    Posted 27 May Link to this post

    Hello Nermeen,

    Error code 3 is a connection error originating from the FileTransfer plugin. That being said, I was unable to recreate the behavior that you experienced. I would ask you to provide us with a sample application that reproduces the problem, so we could investigate this issue further.

    Regards,
    Garo
    Telerik
     

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

     
Back to Top