Hello
AS OF MY KNOWLEDGE...
file.exist works for local file system, if you want to check the remote file, then use is this way
//Make reference to this
using System.Web;
//Check the content length.
string sMonitoringURI = "http://www.somesite.com/images/image.jpg";
WebRequest wrq = WebRequest.Create(sMonitoringURI);
//Begin: Only needed if you are connecting to internet via proxy
WebProxy wp;
wp = new WebProxy("192.168.0.1", 8080);
wrq.Proxy = wp;
//End:
WebResponse wrp;
wrp = wrq.GetResponse();
long l = wrp.ContentLength; //Over Here
wrp.Close();
wrq.Abort();
And rest as you know already.
I guess I have understood your problem, If not let me know will try to fix it in better way. Hope this helps.
With Regards,
Raghavendra Mudugal
|