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 9259791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:44:32+00:00 2026-06-18T12:44:32+00:00

I have, in a WebForm (on .NET 3.5) a byte[] , which represent a

  • 0

I have, in a WebForm (on .NET 3.5) a byte[], which “represent” a PDF file.

Well, I’d like to send it to the client, during a request (postback) from this page.

How can I do it? Tried searching, but I find only tutorial of byte[] from client to server.

  • 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-06-18T12:44:33+00:00Added an answer on June 18, 2026 at 12:44 pm

    You can do it this way, but you might have to clear the Response first to remove all the other page controls etc.

    protected void Page_Load(object sender, EventArgs e)
    {
        var byteArray = File.ReadAllBytes("test.pdf");
    
        Response.ContentType = "application/pdf";
        Response.AddHeader("content-disposition", "attachment;filename=test.pdf");
        Response.BinaryWrite(byteArray);
        Response.Flush();
    
        Response.End();
    }
    

    I usually create an IHttpHandler or WCF REST service to serve up files though.

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

Sidebar

Related Questions

I have an asp.net webform which will display a PDF file. This pdf is
I have an ASP.NET webform which I want to validate Client-Side and Server-Side, using
I have an ASP.NET webform on which I use a DropDownList control to allow
I have an ASP.NET Webform which currently calls a Java WebService. The ASP.NET Webform
I have a basic asp.net webform that handles events via standard postback. On this
I have an button in my Jquery mobile page, which is using asp.net webform.
i have gridview in my asp.net webform. i bind my database to gridview like
i have a textbox1 in my asp.net webform which shows the server side date
I have asp.net webform website, which i have migrated to asp.net mvc. Now I
I have a .NET webform that has a file upload control that is tied

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.