This question is locked. New answers and comments are not allowed.
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);
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);
6 Answers, 1 is accepted
0
Jonas
Top achievements
Rank 1
answered on 26 Feb 2014, 05:03 AM
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?
0
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:
Regards,
Nadya
Telerik
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)
0
Odin
Top achievements
Rank 1
answered on 11 Dec 2014, 07:46 PM
Are there any news about adding support for the headers in options?
0
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
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.
0
nermeen
Top achievements
Rank 1
answered on 24 May 2016, 11:59 AM
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
0
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
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.