Android Question Download get older file

Robert Valentino

Well-Known Member
Licensed User
Longtime User
I am sure this bug / problem is related to my environment

I use HttpJob to download a small file from my website.

Works perfect (first time). If I change the file and upload it to my website and try the download again I am getting the old file.

I am sure it is being cached somewhere and something is not noticing that the file on the website is different and giving me the old copy.

I have tried clearing the cache in Setting -> Applications -> MyApp ( being my apps name )
I tried rebooting the device

And still wrong. I have to wait until tomorrow or the next day before I can get the new file.

If I change the file name then everything works again that one time.

I use FatCow.com as a hosting agent
I use Exede as my internet provider (only choice for me living in the middle of nowhere)
My device is a Samsung Tablet Galaxy Tab 3

ANYONE have any ideas on how to always get the current file and not a cached one

Thanks

BobVal
 

Pendrush

Well-Known Member
Licensed User
Longtime User
Did you try to download same file with your desktop web browser and check it's new or "old" file?
 
Upvote 0

Robert Valentino

Well-Known Member
Licensed User
Longtime User
Interesting. As soon as I downloaded it using my PC browser then I was able to get it using my Android device.

What does this mean?

PS: Thanks so much
 
Upvote 0

Pendrush

Well-Known Member
Licensed User
Longtime User
B4X:
Dim job1 As HttpJob
job1.Initialize("Job1", Me)
job1.Download("http://www.example.com/1.zip") 'add your path here
job1.GetRequest.SetHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:49.0) Gecko/20100101 Firefox/49.0")

Maybe User-Agent is source of the problem, by default OkHttp use this user agent: okhttp/2.4.0
 
Upvote 0

Robert Valentino

Well-Known Member
Licensed User
Longtime User
Tried Pendrush suggestion got a EOF error

Will try what you suggest Erl.

I believe this is probably an Exede problem (satellite server doing cache) reason I say this, is I do have this problem in Windows as well.

For the time being, I just am using a different file name each time. Once testing is done file will be changing very little

Thanks
 
Upvote 0
Top