Android Question [Solved] firebase image download problem

AymanA

Active Member
Licensed User
Hi All,

I have code to download the firebase image, and it was working well with the same code for two days, for some reason today I have started to receive errors, I have searched everywhere but can not find out what might be the problem.

code to download the image::
Sub DownloadAndSaveFile (Link As String) As ResumableSub
    Dim j As HttpJob
    j.Initialize("", Me)
    j.Download(Link)
    Wait For (j) JobDone(j As HttpJob)
    If j.Success Then
        Dim out As OutputStream = File.OpenOutput(File.DirInternal, "FCMphoto.png", False)
        File.Copy2(j.GetInputStream, out)
        out.Close
        
    End If
    j.Release
    Return Null
End Sub


Error received::
ResponseError. Reason: java.net.SocketTimeoutException: failed to connect to lh3.googleusercontent.com/xxx.xxx.x.x (port 443) from /xxx.xxx.xx.xx (port 43085) after 30000ms, Response:
 

DonManfred

Expert
Licensed User
Longtime User
i suggest to copy the file to your server and use your serverurl.
Or better directly add it to your files-folder. no need to download a file.

Maybe you are blacklisted?

What is the full url to the image?
 
Upvote 0

AymanA

Active Member
Licensed User
Thank you so much for your help and suggestion.

Will definitely keep into consideration to save it internally, rather than download every time!

Seems I am not blacklisted as I can see the image through the URL: https://lh3.googleusercontent.com/a-/AOh14GhytMXhqyx0G0NsLCDIkS1lJls0xBMhG9TuQQG5=s96-c

Today it is working with no problem with the exact same code! so seems it was google problem or something else I am not aware of!

Thank you so much for your help, I really appreciate it.
 
Upvote 0
Top