problems with Process.Start()

Discussion in 'General troubleshooting' started by fred, Jan 23, 2010.

  1. Hi,,
    I'm trying to brows a files i previously successfully uploaded to the Winhost server, such as notpad, .jpg ... I used the following code to brows:

    try
    {
    string server_path = HttpContext.Current.Server.MapPath("~/uploads/");
    string path = server_path + filename.Text;
    System.Diagnostics.Process.Start(path);
    }
    catch
    {
    lblatta.Text = "Document " + filename.Text + " not found";
    }

    I get the following error :

    System.security.securityException: Request Failed.

    I solved this error by placing the following code in the web.confg:

    <system.web>
    <trust level="Full" />
    </system.web>

    the error disappear but no file open.

    can any one help. knowing that site work perfectly on the localhost.
    thanks in advance.
     
    Last edited by a moderator: Oct 14, 2015
  2. Ray

    Ray

    Did you check the path on your application. The paths on the web server maybe different to what path you have on your local computer.
     
  3. I checked the path of the local computer with the path of the host server they are the same,assuming that ~/ represent the server path weather for the local computer or the host.
    don't you think it is a permission issue?
    If it didn't work, is there another way to brows a doc or image stored at the host server??
     
  4. Ray

    Ray

    If it is a permission issue, you would definitely get an application error with some sore of permission setting error.
     

Share This Page