Click here to Skip to main content
15,885,020 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
Hi,
I have integrated windows application as setup file(.msi) in web application. I can access it.
Now my problem is that onclick of save button in web page i can call SaveAs dialog from windows but the file is not storing in the local machine.
My code
This code Form.cs in windows application
C#
 <public void="" mode="hold" />       {
           string newFilePath = string.Empty;
           saveFileDialog1 = new SaveFileDialog();
           saveFileDialog1.FileName ="filename1";
           saveFileDialog1.Filter = " ";
           if (saveFileDialog1.ShowDialog() == DialogResult.OK)
           {
             //here i will have new path
           }
           string oldFilePath = userControl1.IFilePath;
           if (System.IO.File.Exists(oldFilePath))
           {
              //old path

           }

       }


userControl in Windows application
  void SaveFile()
        {
            Form a = new Form();
            a.savebtn();
        }
I called the above method in Web application. The SaveAs dialog opens onclick of save button in web page but it does not saves the file.
Thanks in advance!
Posted
Updated 14-Aug-15 1:41am
v2
Comments
Richard Deeming 14-Aug-15 9:36am    
How are you launching the windows application?

If you're doing it from the code-behind / controller, the application is running on the server, where nobody will ever see it. It might appear to work when you run the site from Visual Studio, but that's only because the server and client are the same computer in that case.
Sinisa Hajnal 17-Aug-15 3:54am    
You cannot save it the way you're trying to. You have to provide download link to get it, not windows Save As... dialog -> this will run on the server and save "locally" on the server. This is same as calling MessageBox in the code-behind - the message will appear on the server and block the application until someone ON THE SERVER closes it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900