M mw71 Well-Known Member Licensed User Longtime User Sep 13, 2018 #1 Hi i would like download ab File from a Webserver. The URL is like: www.Server.net/script.php?r=XX The Server generate a GPX File for Download. Whith this Code a can Download the File, unfortunately i cant get the File Name from the Server. (with the Browser i get the File Name) Code: Copy Dim h_dl_gpx As HttpJob Dim url As String = "https://www.Server.net/script.php?r=XX" h_dl_gpx.Initialize("TestGPX",Me) h_dl_gpx.Download(url) Wait For (h_dl_gpx) JobDone(h_dl_gpx As HttpJob) How can i get the Filename or save the File under a defined File Name??
Hi i would like download ab File from a Webserver. The URL is like: www.Server.net/script.php?r=XX The Server generate a GPX File for Download. Whith this Code a can Download the File, unfortunately i cant get the File Name from the Server. (with the Browser i get the File Name) Code: Copy Dim h_dl_gpx As HttpJob Dim url As String = "https://www.Server.net/script.php?r=XX" h_dl_gpx.Initialize("TestGPX",Me) h_dl_gpx.Download(url) Wait For (h_dl_gpx) JobDone(h_dl_gpx As HttpJob) How can i get the Filename or save the File under a defined File Name??
DonManfred Expert Licensed User Longtime User Sep 13, 2018 #2 You can not get the filename this way. You need to have another phpscript which provides the filename. To save the result to any place you need to use the outputstream like for any other download. Search the forum; there are hundrets of similar questions. Upvote 0
You can not get the filename this way. You need to have another phpscript which provides the filename. To save the result to any place you need to use the outputstream like for any other download. Search the forum; there are hundrets of similar questions.
OliverA Expert Licensed User Longtime User Sep 13, 2018 #3 mw71 said: (with the Browser i get the File Name) Click to expand... How? Upvote 0
DonManfred Expert Licensed User Longtime User Sep 13, 2018 #4 mw71 said: How can i get the Filename or save the File under a defined File Name? Click to expand... Try to edit the source modules to find out - maybe - the filename which is stored in a result header (hopefully). https://www.b4x.com/android/forum/threads/httputils2-getheaders.45051/#post-276497 Upvote 0
mw71 said: How can i get the Filename or save the File under a defined File Name? Click to expand... Try to edit the source modules to find out - maybe - the filename which is stored in a result header (hopefully). https://www.b4x.com/android/forum/threads/httputils2-getheaders.45051/#post-276497
Erel B4X founder Staff member Licensed User Longtime User Sep 13, 2018 #5 DonManfred said: Try to edit the source modules to find out Click to expand... It is not required. OkHttpUtils2 v2.70 allows you to access the response object with Job.Response. Upvote 0
DonManfred said: Try to edit the source modules to find out Click to expand... It is not required. OkHttpUtils2 v2.70 allows you to access the response object with Job.Response.
M mw71 Well-Known Member Licensed User Longtime User Sep 13, 2018 #6 OliverA said: How? Click to expand... in the Browser the "save as" Window is open Erel said: It is not required. OkHttpUtils2 v2.70 allows you to access the response object with Job.Response. Click to expand... thanks Erel, i see, i use the HttpUtils2 version 2.01 Class Modul, time for Update and Check. At the moment i use a (little bit more) code and save the File under a defined file name. Upvote 0
OliverA said: How? Click to expand... in the Browser the "save as" Window is open Erel said: It is not required. OkHttpUtils2 v2.70 allows you to access the response object with Job.Response. Click to expand... thanks Erel, i see, i use the HttpUtils2 version 2.01 Class Modul, time for Update and Check. At the moment i use a (little bit more) code and save the File under a defined file name.