I want to find what is the extension of file in current URL.
I have used
http://tol.imagingtech.com/eIL/cgi-bin/eIL.pl?ACTION=get_trans_doc&DOC=ALL&CAB_NAME=TOL_AP_2012&WHSE=18&PAYEE=23003655&INV=01235770
The extension of this file is (.pdf) how can i get this. Sometimes it will be (.doc,.txt,.jpeg) so i want the exact one.
Following is the code which i used to retrieve file extension
var extFile = Document.DocumentFilePath.Split('.');
return "Backup document." + extFile[extFile.Length-1].Trim().ToLower();
It works fine for normal local path but it fails to retrieve extension which DocumentFilePath is url.