I am developing online PDF converter for our company, user enter URL in html form and get PDF after submiting it.
The problem is that I can't find out is submited URL is web page or file. I have tried to write URL string parser, but
parsing url string is not the best method, it is impossible to find URL type from parametrized
URL. For example URL http://www.mydomain.com/?File=MyFile
, not possible to know from URL what content I should get by clicking on it - web page or file.
I need find out function which will work like IE do while entering URL in URL box, it detect if URL content is web page it load it to IE if file - show file download dialog and put file name in file dialog.