Downloaded file should open after sending the information to the server.

dprasad used Ask the Experts™
When user opens a downloaded file, that file should open when it interacts with the server.File what ever we downloaded from server should not open if the user don't have interaction with the server..

Please suggest me on this and how can i proceed further.

Thanks in advance,
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Full stack Software Engineer
You could try ping the server or try use head request or download default page .

//you could use either ip or hostname
var ip = "";
var hostname = "";

  Ping pinger = new Ping ();

            byte[] buffer = Encoding.ASCII.GetBytes ("test123");
            int timeout = 60;
            PingReply reply = pinger.Send (ip, timeout, buffer);
            if (reply.Status == IPStatus.Success)

Open in new window

head request:

HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest;
request.Method = "HEAD";
HttpWebResponse response = request.GetResponse() as HttpWebResponse;
WebHeaderCollection headers = response.Headers;

}catch(Exception ex){

Open in new window

download default page:
WebClient client = new WebClient ();
        string reply = client.DownloadString ("");

Open in new window

based on
Meir RivkinFull stack Software Engineer

why grade C?

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial