Android Question Downloadinf file FORBIDDEN

AlpVir

Well-Known Member
Licensed User
Longtime User
My app downloads an XML file to a certain URL but in the sub
Sub HC_ResponseError (Reason As String, StatusCode As Int, TaskId As Int)
of DownloadService.bas
"Reason" is equal to FORBIDDEN and StatusCode = 403.
It would seem a folder permissions problem but, using a PC and Firefox, you can normally download it to the same URL.
Why ?
How to overcome it ?
 

AlpVir

Well-Known Member
Licensed User
Longtime User
Using OkHttpUtils2 the error is as follows


It may be that in the url there is one "~" ?
With "normal" url on other sites, there is no download problem, either with DownloadService or with OkHttpUtils2.

EDIT:
Not even using
B4X:
URL="www.itcbonelli.gov.it/~orario/oraedt.xml"
    url2=su.EncodeUrl(URL, "UTF8")
    job.Download(url2)
 
Last edited:
Upvote 0

KMatle

Expert
Licensed User
Longtime User
This works:

B4X:
Dim TestJ As HttpJob
    TestJ.Initialize("TestJob", Me)
    TestJ.Download("http://www.itcbonelli.gov.it/~orario/oraedt.xml")

Result:

B4X:
<PERIODICITA>S</PERIODICITA>
<SPECIFICA>ss</SPECIFICA>
<CO-DOC.>N</CO-DOC.>
<COEFF.>60/60</COEFF.>
<GIORNO>venerdì</GIORNO>
<O.INIZIO>12h00</O.INIZIO>
<SEDE>Principale (PALESTRA)</SEDE>
....

Reason:

Download2 escapes the parameters, Download doesn't
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…