if ansipos('application/pdf', response.GetHeader('Content-Type') )>0 then
begin
DownPdfUrl:=request.Url ;
end;
I found the problem, It is case sensitive for 'Content-Type'.
Thank you very much!
Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
How to know if there is error when downloading files?
Re: How to know if there is error when downloading files?
This may be a bug?
sometimes, response.Header contains 'Content-Type'.
'content-type' also can exist in another response.Header.
but response.GetHeader() is case sensitive!
'Content-Type' and 'content-type' cannot coexist in one response.Header. So response.GetHeader() need to be case sensitive?
sometimes, response.Header contains 'Content-Type'.
'content-type' also can exist in another response.Header.
but response.GetHeader() is case sensitive!
'Content-Type' and 'content-type' cannot coexist in one response.Header. So response.GetHeader() need to be case sensitive?
- salvadordf
- Posts: 4052
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: How to know if there is error when downloading files?
Use response.GetHeaderMap to get a ICefStringMultimap instance with a list of all the headers and use a case insensitive function to search for the content type header.
Re: How to know if there is error when downloading files?
But it need more codes
Thank you!
Thank you!