You must Sign In to post a response.
  • Category: .NET

    Save file in local c drive

    Hi All,

    I am trying to put my exe windows application to web application. I have created one web application and put exe file and some other output folder like "Search Results" that shown in below code in Bin folder of web application. Now I just want to know how I can save the file 'new' below in local C: drive when I host the application.

    xlWorkSheet.SaveAs(Application.StartupPath.ToString + "\Search Results\new.xlsx")

    Thank You
  • #766364
    you can not access local drive of client machine using, can use JavaScript and ActiveX (FSO) to get client system's directory/folder list. However, just as NC and Josh pointed out, we need every client machine grant the proper permissions. And the Scripting.FileSystemObject is only supported by Internet Explorer.
    So, sadly to say, we can use JavaScript and ActiveX (FSO) to get client system's directory list, but that solution is unsuitable for your scenario.
    MSDN says
    One important thing to keep in mind when using the FileSystemObject is permissions! In Windows NT, there are three types of permissions: Read, Write, and Full Access. Whenever an ASP page attempts to execute some file system command using FSO, the anonymous web user ID is used: IUSR_machinename

    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]

  • #766862
    You can see my article which is referred to here

    Second option is you can use Webclient method in windows application to save the file in your local computer


  • Sign In to post your comments