Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Can I generate a .txt or .csv dynamicly and provide a link for it to be downloaded/streamed?

Can I generate a .txt or .csv dynamicly and provide a link for it to be downloaded/streamed?

Scheduled Pinned Locked Moved ASP.NET
sysadminquestion
2 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Red_Wizard_Shot_The_Food
    wrote on last edited by
    #1

    is it possible to have a link/button/etc that when clicked creates a CVS from a dataset (that bit i can do) then presents it as a download without having to write the file to the server? So basicly when they click the link/button it streams the data from the dataset into a text file that is being downloaded. Thanks

    N 1 Reply Last reply
    0
    • R Red_Wizard_Shot_The_Food

      is it possible to have a link/button/etc that when clicked creates a CVS from a dataset (that bit i can do) then presents it as a download without having to write the file to the server? So basicly when they click the link/button it streams the data from the dataset into a text file that is being downloaded. Thanks

      N Offline
      N Offline
      Naveed Kamboh
      wrote on last edited by
      #2

      Yes it is possible dear follwoing code may be help full //HTMl Document public void Create_HTML_Document(string strBody,string filename) { try { string header = "News letter"; header += strBody; header += ""; header += ""; StreamWriter sw = File.CreateText(Server.MapPath("../NewsLetters/") + filename +".txt"); sw.Write(header); sw.Close(); } catch (Exception) { } }

      Naveed Kamboh Complexity kills, Write easy code for your self. isolutionteam

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups