Results 1 to 5 of 5

Thread: File Dialog

  1. #1

    Thread Starter
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Question File Dialog

    Hi all
    can any one please tell me
    How to use open file dialog on web page, code in c#, What is the code,
    Thanks

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: File Dialog

    I assume you want to give the user the option of downloading a file to their system via the save as dialog?
    VB Code:
    1. Response.Clear();
    2. Response.AppendHeader("content-disposition", "attachment; filename=document1.doc");
    3. Response.ContentType = "text/plain";
    4. Response.WriteFile(Server.MapPath("document1.doc"));
    5. Response.Flush();
    6. Response.End();
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Thumbs up Re: File Dialog

    Quote Originally Posted by RobDog888
    I assume you want to give the user the

    Sir Thanks For reply
    I want the code to see the drive of the computer and the folder in the computer where the website is running. Just like the directory list box and the Drive control in the VB, where we see the entire directory on that PC, and the entire directory.

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: File Dialog

    You will need to bind a fileinfo object to your datalist's datasource property to list files on the server. This is VB as I am still weak in C#

    VB Code:
    1. Dim dirInfo As New DirectoryInfo(Server.MapPath("C:\"))
    2. Dim fInfos As FileInfo() = dirInfo.GetFiles("*.*")
    3. DataList1.DataSource = fInfos
    4. DataList1.DataBind()
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5

    Thread Starter
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Thumbs up Re: File Dialog

    Quote Originally Posted by RobDog888
    You will need to bind a fileinfo object to your datalist's datasource property to list files on the server. This is VB as I am still weak in C#
    Sir Thanks for reply i will tell you in the evening , after checking the detail...
    And trying for it
    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width