c# - ASP.NET, Webservice response as a download link for Android -



c# - ASP.NET, Webservice response as a download link for Android -

because webservice supposed consumed using android device, based on friend had told me, said way have download file , read there.

this project not going live, demonstrated on 1 computer. file can saved in c:\ folder, instead of live server.

so right trying find way homecoming download file link, instead of original xml format. download link format looking .xml.

my web service in format:

i have location.cs

public list<locations> ws(string parameter) { list<locations> abc = new list<locations>(); // on here populate abc list objects. homecoming abc; }

as far asp.net , c# part concered can .

whenever have file info should write file . , phone call function passing path , file name want appear other end .

//forces download/save rather opening in browser// public static void forcedownload(string virtualpath, string filename) { response.clear(); response.addheader("content-disposition", "attachment; filename=" + filename); response.writefile(virtualpath); response.contenttype = ""; response.end(); }

c# asp.net android web-services download

Comments

Popular posts from this blog

java - How to pass parameters between Request-Scoped Controllers? -

string - what is the difference between "some" == "some\0" and strcmp("some","some\0") in c++? -

actionscript 3 - Flex: moving a point with rotation doesnt change the point XY? -