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

  • Home
  • SEARCH
  • 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 3608464
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:30:16+00:00 2026-05-18T21:30:16+00:00

I have a form with 10 file inputs. They can contain 10 random files

  • 0

I have a form with 10 file inputs. They can contain 10 random files with random sizes.
If I send these files to ASP.NET server with this code:

var count = HttpContext.Current.Request.Files.Count;
var TotalSize = 0;
for (int i = 0; i < count; i++ )
{
    HttpPostedFile postedFile = HttpContext.Current.Request.Files.Get(i);
    TotalSize += postedFile.ContentLength;
}

And as you can see I didn’t save the files on the server, will this code just calculate the summary of files without need to receive the whole file from the client (And therefore it would be very fast)?

  • 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-18T21:30:17+00:00Added an answer on May 18, 2026 at 9:30 pm

    Your code above will not run until ALL of the files are loaded on the server, and therefore will not be fast (if the uploaded files are large).

    There are ways to check the size before actually uploading the whole file, but not in your code of the page itself. You either have to use an HttpModule/Handler to do the upload, or use a Flash/Silverlight component to check the file size on the client BEFORE uploading.

    Here’s a page with some good info on the problem and links to solutions.

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

Sidebar

Related Questions

I have a form with several inputs that deal with files. The javascript validation
I have a contact form in my flash file with name/email/message fields which a
I have a classifieds website, where anyone (no need for login currently) can post
I have a form that has two buttons. One for saving a record and
hey, well I have this form <form method=POST action=''> <input type=hidden name=op value=download1> <input
I have a form with multiple fields, and each time the user changes a
I'm noticing what I think is a bug with Zend_Form_Element_File. Can others please test
At the moment I have a very simple autoresponder/chatbot. To get it to play
I installed Linpack on a 2-Node cluster with Xeon processors. Sometimes if I start

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.