How to handle 307 temporary redirect?

I wrote an app that (wish to) downloads all the covers of my audio library albums.
From artist and album tags i search the and parse the html, but when i got the jpeg location from the mdib i got something like this:

but downloading do not works 'case real url is redirected from servers to:

i do not know how to handle the temporary redirect … so my downloaded jpg is 0 bytes …

Hello, every app developer is welcome, but your question is too short and cannot be answered. It just depends on the programming language you wrote the app in. Maybe search/ask a general developer forum dedicated to your programming language instead:

thanks yVanzo.
I was asking because i wrote apps in GAMBAS ( and apis are for java or C/C++ i both hate a lot :smiley:

just joking, but i asked to the language forum and they proposed me to write a wrapper to the C api … too complex for me.

so i wonder if there was an “easy” way to ask the server the REAL (not redirected) URL for the picture?

AFAIK, there is no other way than supporting download redirects. Fortunately, all you need for this is the class HttpClient ( The property Code can be checked for HTTP status 307. And the redirected URL can be retrieved by looking at the property Headers for the Location field.


i got a 302 not 307, but I GOT THAT info in the header!!!

REALLY really thanks a lot!!!

1 Like