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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:59:11+00:00 2026-05-26T21:59:11+00:00

I need to be able to upload several files to a database, and associate

  • 0

I need to be able to upload several files to a database, and associate them with a given record in a given table. I initially thought about zipping all the necessary files and send the resulting byte array as a parameter along with the remaining record data to a stored procedure, so that I could both be sure that this acts as a single transaction and that retrieving all the files associated with a given record would be a piece of cake. However, this plan was not accepted for performance reasons, and now I am left with two options:

  1. Create a data structure which wraps an array of byte[], (binary-)serialize it and send it along with the data; or

  2. Send the remaining data first, catch the ID of the record and send each file separately (associating it with the given ID);

Now, 1) looks too much like my first plan and is likely to be rejected even though this time no compression would be involved. Option 2) seems to be the way to go, but, however, I must guarantee that I upload both the record’s data and the files in a single transaction, which will force me to make changes (albeit slight) in my data layer…

If you were facing this problem, which option would you choose? If none of those I stated above, which one then?

Edit: The database is located in a remote server. The files can be arbitrarily large, although I don’t expect them to be larger than, say, 1-2MB. Storing the files in a location accessible by both the application and the database server is not an option, so that I can’t just send paths to the files to the database (they must really be stored as BLOBs in the database).

  • 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-26T21:59:11+00:00Added an answer on May 26, 2026 at 9:59 pm

    Your first plan was rejected due to performance issues – presumably this means network transfer speed?

    Your alternate plan is to send the files individually & then tie them together on your server. That’s a fine plan, but you want to ensure all the files are uploaded and committed in a single transaction. Following from that, your server can’t respond with a success signal until it’s received all the files and successfully committed them.

    So you second scenario requires the same amount of data to be uploaded in the transaction. How then will it be able to perform any better?

    In fact, any possible design you can come up with – assuming the files need to be received within a single transaction – will have the same ‘performance issue’.

    You may have a different understanding of ‘transaction’ than I do, but typically you can’t go and use the originally submitted ‘remaining data’ until the transaction is complete. I think your problem is around the required ‘single transaction’ nature of your system, rather than any network bottleneck.

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

Sidebar

Related Questions

I need the user to be able to upload multiple files to my server,
I need my Windows Phone application to be able to upload audio files to
Im building an app using kohana. I need to be able to upload files
I need to be able to encrypt files before storing them on S3, and
I need to use HttpWebClient to upload a series of files at once. I
From my php script, i need to be able to upload a csv file
I need to provide a feature such that the user is able to upload
Alright, so heres my problem, i need my user to be able to upload
I need to upload data in an excel sheet to the database using java.
To be able to upload large files from a HTML page to a FTP

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.