locked
Specifying the location of a file that’s automatically generated RRS feed

  • Question

  • User1953081067 posted

    Hi

    Thanks to other posts from this forum I’ve put together a script that generates a CSV file based on the content within a DataSource. Thing is, I’d like to give the user the option to specify the location of where the file will be generated – i.e., when they click ‘Make CSV’, they are prompted with a ‘SaveAs’ dialog box.

    The code I’m currently using for specifying the file location is:

    StreamWriter sw = new StreamWriter("c:/griddata.txt");<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>Can someone please show me what I would need to add/change to provide a ‘SaveAs’ dialog box? I’m a beginner (in my eyes at least) so any examples would really be apreciated.<o:p></o:p>

    Many thanks
    Richard

    Monday, June 4, 2007 7:26 AM

Answers

  • User-2115483147 posted

    Hi

    Thanks to other posts from this forum I’ve put together a script that generates a CSV file based on the content within a DataSource. Thing is, I’d like to give the user the option to specify the location of where the file will be generated – i.e., when they click ‘Make CSV’, they are prompted with a ‘SaveAs’ dialog box.

    The code I’m currently using for specifying the file location is:

    StreamWriter sw = new StreamWriter("c:/griddata.txt");Can someone please show me what I would need to add/change to provide a ‘SaveAs’ dialog box? I’m a beginner (in my eyes at least) so any examples would really be apreciated.

    Many thanks
    Richard

    Hi RichardLaw,

    See the following article,

    http://west-wind.com/weblog/posts/76293.aspx (Downloading a File with a Save As Dialog in ASP.NET)

    This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

    Hope it helps,

    Hong Gang<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 5, 2007 10:23 AM

All replies

  • User-2115483147 posted

    Hi

    Thanks to other posts from this forum I’ve put together a script that generates a CSV file based on the content within a DataSource. Thing is, I’d like to give the user the option to specify the location of where the file will be generated – i.e., when they click ‘Make CSV’, they are prompted with a ‘SaveAs’ dialog box.

    The code I’m currently using for specifying the file location is:

    StreamWriter sw = new StreamWriter("c:/griddata.txt");Can someone please show me what I would need to add/change to provide a ‘SaveAs’ dialog box? I’m a beginner (in my eyes at least) so any examples would really be apreciated.

    Many thanks
    Richard

    Hi RichardLaw,

    See the following article,

    http://west-wind.com/weblog/posts/76293.aspx (Downloading a File with a Save As Dialog in ASP.NET)

    This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

    Hope it helps,

    Hong Gang<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 5, 2007 10:23 AM
  • User1953081067 posted

    Perfect - thank you.

    Tuesday, June 5, 2007 11:01 AM