Android Question Download a file in a Webview

DNA

Member
Licensed User
Hi,

I am currently stuck, and can't figure out what to do.
Our website/mobisite requires you to log-in with your credentials, one of the options is to allow you to download a pdf file. In a normal browser and in the phone's browser when you logged in, and click on the download link the file is downloaded.

When you are logged in on the webview, and click the download link to download the pdf, I use a httpjob to download the file but get the unauthorized access please login error message.

What am I doing wrong?
 

DNA

Member
Licensed User
Yes I can, but not at the moment, the app is locked, need to ask the db administrator to unlock the user in the backend before I can post the log. Do you have any advice for me in the meantime.
 
Upvote 0

DNA

Member
Licensed User
Hi
the server's response is Unauthorized access please login and try again, this is after the user has initially logged in on the webview.
 
Upvote 0

DNA

Member
Licensed User
So the same password that the user initially logs into on the webview should be used like this
job.username
job.password
job.download(url)
 
Upvote 0

ronell

Well-Known Member
Licensed User
Longtime User
I think its a Yes
.. But Why are you using webview, you can directly download the file using the url,

E.g
B4X:
Job.download("http\\url.com\file")
Then handle the file in jobdone
 
Upvote 0

DNA

Member
Licensed User
Yip that is exactly what I am doing. Using an job.download to download the file, but when JobDone comes back the job.getstring that is return is Unauthorized access, login and try again.
 
Upvote 0

DNA

Member
Licensed User
So the syntax would be
job.jobname
job.username
job.password
job.download

Do you need to do a job.username and job.password or job.poststring?
 
Upvote 0
Top