Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7438583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:34:38+00:00 2026-05-29T10:34:38+00:00

I have a file on my server or well in this localhost. I want

  • 0

I have a file on my server or well in this localhost. I want to transmit it to user using this code:

        Response.ContentType = "application/pdf";
        Response.AppendHeader("Content-Disposition", "attachment; filename=buylist.pdf");
        Response.TransmitFile(Server.MapPath("~/buylist.pdf"));

        Response.ContentType = "application/csv";
        Response.AppendHeader("Content-Disposition", "attachment; filename=buylist.csv");
        Response.TransmitFile(Server.MapPath("~/buylist.csv"));

I know the file I am trying to transmit our fine and I even tried adding Response.Close() but each time the file is corrupted. The csv give me the page’s HTML. I am really lost.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T10:34:38+00:00Added an answer on May 29, 2026 at 10:34 am

    Try putting a Response.Clear() at the top of this code, and a Response.End() and bottom.

    Also, it looks like you’re trying to transmit two files in one response, and that just won’t work. It might also be two versions of the code showing in the same snippet in your question, but this is still worth mentioning: You need to pick one file to return in one response. If you absolutely must return two files at once, you’ll have to zip or tar them together first. There is no way to send two files with the same response.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a pdf file on my server. I want to create such link
I'm using PuTTY to access my BSD file server and I have several terminal
I have the following code in ://localhost/.htaccess... AddType application/x-httpd-php5 .css .js RewriteEngine on RewriteRule
I have to develop a file server service that transfer file form a specified
I have been working on designing a file server that could take the load
I have a requirement to allow users to browse directories on our file server,
I have a file on a Windows 2003 server which is locked by a
I have a file foo.bar.1 on my server and when I try to access
I have a file called error.log on my server that I need to frequently
I have an HTML file on my server, and a Javascript file on the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.