0

I have no idea of how to download a file using a C# web service.

Please help me with the following C# code.

var fileTransfer = new FileTransfer();
var uri = encodeURI("http://some.server.com/File.docx");

fileTransfer.download(
    uri,
    downloadPath,
    function(entry) {
        console.log("Download compelete: " + entry.fullPath);
    },
    function(error) {
        console.log("Download error source " + error.source);
        console.log("Download error target " + error.target);
        console.log("Upload error code" + error.code);
    },
    false
);

But I don't want to give a URL like this. I want to download through Webservice. Is it possible?

Erik Gillespie
  • 3,929
  • 2
  • 31
  • 48

1 Answers1

0

Your question is very vague. I would suggest adding more details to try and get more answers. I can make the following recommendations for you to look into:

  1. Cordova File Plugin - This plugin allows your cordova app to mess with the files on the mobile's devices disk. I.e this lets you read and write files locally.
  2. Cordova File Transfer Plugin - This plugin allows you to connect to remote services (for example your C# service) and download files from them.
  3. Cordova White List Plugin - This is essential if you want to connect to external websites and services. Without this plugin and without defining your whitelist in config.xml you will not be able to connect to anything remotely.

I would also recommend looking at this and this for more info.

Community
  • 1
  • 1
Filipe Teixeira
  • 3,565
  • 1
  • 25
  • 45