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
Post a Comment