It tries to get the real file name using three methods:
- First by checking if the server returned the name of the original file to save as (using the content-disposition http header)
- By checking the content-type header that the server returned
- If all else fails then by the filename in the requested url.