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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T11:31:17+00:00 2026-06-07T11:31:17+00:00

My asp.Net MVC app needs to store a byte array that represents a user-selected

  • 0

My asp.Net MVC app needs to store a byte array that represents a user-selected PDF file per record in the database. The SQL column is a Varbinary(max).

The approach I’m contemplating is to use Telerik’s (most awesome) KendoUI Upload control to asynchronously upload the selected PDF to the controller method. The controller method converts the PDF to bytes using classes in the System.IO namespace, and I return that byte array in a Json result. I have an event handler on the page that waits for this result, and then writes that byte array to a hidden input, which then gets saved with the rest of the record when the user clicks the save button, posting the Form back to the server.

My gut feel is that I have some nasty inefficiency here…

  1. the pdf is sent to the server (probably already in some form of byte array created by the Upload control).

  2. the result of the upload method returns a byte array back to the page.

  3. the page then submits the form postback, containing the byte array that will be saved to the database.

My thinking is that step 3 is the only network traffic required here. Is there any way that conversion from a PDF document to a byte array can happen on the client instead? What clever JavaScript/jQuery would do this?

  • 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-07T11:31:20+00:00Added an answer on June 7, 2026 at 11:31 am

    Here:

    The controller method converts the PDF to bytes using classes in the
    System.IO namespace, and I return that byte array in a Json result. I
    have an event handler on the page that waits for this result, and then
    writes that byte array to a hidden input, which then gets saved with
    the rest of the record when the user clicks the save button, posting
    the Form back to the server.

    Change this logic to:

    The controller method converts the PDF to bytes using classes in the
    System.IO namespace, and saves it to the database and returns a Json result.
    indicating the success or failure of this operation. No more hidden fields, no
    more byte arrays. When the client submits the form, the file should no
    longer be sent to the server because it was already sent and stored in
    the database. So in the controller action that will process the form
    submission I associate the other form fields with the file in the
    database record.

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

Sidebar

Related Questions

I need to store a file, such that my ASP.Net MVC app can access
Good day, I have a ASP.net MVC app that needs to upload files to
I have an action filter in an ASP.NET MVC 3 app that needs some
I'm creating an ASP.NET MVC app that uses EF to perform all DB tasks.
I'm building an ASP.NET MVC app and I'm using a repository to store and
I am writing an asp.net MVC app that drives an IPhone application. I want
I have an asp.net mvc app which has membership implemented. So a user has
I have a medium sized asp.net MVC app. It consumes a service layer that
I have an ASP.NET MVC app that stores all SQL DateTime in UTC, so
I have an asp.net mvc app that is built to run as standard web

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.