none
Not able to Get the Browse option while saving the FILE in to my Desktop RRS feed

  • Question

  • Hi All,

    Please help me on below issue.

    I am able to create "example.xml" file under "C" drive, but not able to provide Browse option to the user to save the file in his system.

    I need to provide Browse option to the user, so that he can save  "example.xml " file where ever he wants (i.e, User can save "example.xml" file based on his requirement)

    Below is my code sample: (Asp.Net MVC 3.0), Please some one help me to provide this Browse feature while saving the file.

     public ActionResult Index()
            {        
                System.Text.StringBuilder sb = new System.Text.StringBuilder();
                sb.Append("<?xml version=\"1.0\"?>");
                sb.Append("<?mso-application progid=\"Excel.Sheet\"?>");
                sb.Append("<Workbook xmlns=\"urn:schemas-microsoft-com:office:spreadsheet\" ");
                sb.Append("xmlns:o=\"urn:schemas-microsoft-com:office:office\" ");
                sb.Append("xmlns:x=\"urn:schemas-microsoft-com:office:excel\" ");
                sb.Append("xmlns:ss=\"urn:schemas-microsoft-com:office:spreadsheet\" ");
                sb.Append("xmlns:html=\"http://www.w3.org/TR/REC-html40\">");
                sb.Append("<DocumentProperties xmlns=\"urn:schemas-microsoft-com:office:office\">");
                sb.Append("</DocumentProperties>");
                sb.Append("<ExcelWorkbook xmlns=\"urn:schemas-microsoft-com:office:excel\">");
                sb.Append("<ProtectStructure>False</ProtectStructure>");
                sb.Append("<ProtectWindows>False</ProtectWindows>");
                sb.Append("</ExcelWorkbook>");
                sb.Append("</Workbook>");
                XmlDocument doc = new XmlDocument();
                doc.LoadXml(sb.ToString());            
                doc.Save(@"C:\example.xml");

                return View();


            }
    Wednesday, September 19, 2018 11:37 AM

All replies