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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T00:40:45+00:00 2026-06-06T00:40:45+00:00

I have a program that is developed in MVC 3 Razor Syntax but whenever

  • 0

I have a program that is developed in MVC 3 Razor Syntax but whenever I am posting to the controller with a file it doesn’t work but if I just post to the controller without a file it works. What could be the problem ? Here’s my Code:

@using (Html.BeginForm("UpdateFile", "AdministerFiles", FormMethod.Post, 
new {enctype = "multipart/form-data"})) 

 {
    string title = null;
    string description = null;
    string filename = null;
    int dataid = 0;
    int filesize = 0;
    string filepath = null;
    foreach (var fileDetails in ((RefDataLinks_mst[])@Model[1]))
    {
        title = fileDetails.DataTitle;
        description = fileDetails.Description;
        filename = fileDetails.DataFileName;
        dataid = fileDetails.DataID;
        filesize = fileDetails.FileSize;
        filepath = fileDetails.DataFilePath;
    }

    <div id="updateLeftTopPart">
        <label class="addFileLabel"for="title">Title : </label><textarea rows="3" cols="50" name="title" required>@title</textarea> <br /> <br />    
    </div>

    <div id="updateRightTopPart">
        <label for="description">Description : </label><textarea rows="2" cols="50" name="description" required>@description</textarea>

    </div>
    <div id="updateLeftPart">
        <label>Existing File : </label><label><a href="/BrowseData/DownloadFile?catID=@catid&filename=@filename&filepath=@filepath">@filename</a></label>
    </div>

    <div id="updateUploadFile">
        <label for="file">Upload New File Here :</label><input type="file" name="file" id="file"/>
    </div> 

        <input type="hidden" value="@catid" name="catid"/> 
        <input type="hidden" value="@filename" name="existingFile"/> 
        <input type="hidden" value="@dataid" name="dataid"/> 
        <input type="hidden" value="@filesize" name="filesize"/> 
    <div id="updateActions">
        <input type="submit" value="Update File" />
        <input type="reset" value="Reset" />
    </div>           
 }

These are the parameters of my Controller:

public ActionResult UpdateFile(HttpPostedFileBase file, int catid, int dataid, string title, string existingFile, string description, int filesize)

Whenever I post, The browser is saying that The connection to the server was reset while the page was loading. What could be the problem ?

  • 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-06T00:40:47+00:00Added an answer on June 6, 2026 at 12:40 am

    Whenever I post, The browser is saying that The connection to the
    server was reset while the page was loading. What could be the problem ?

    The default 4MB limit that you could increase in your web.config using the <httpRuntime> element.

    <!-- Allow files up to 100MB to be uploaded -->
    <!-- Also increase the execution timeout as uploading
    100 MB files could take some time and ASP.NET won't wait that long -->
    
    <httpRuntime maxRequestLength="102400" executionTimeout="3600" />
    

    By the way if you host your application in IIS 7+ you also need to adjust the requestLimits to the same value (in bytes this time):

    <system.webServer>
        <security>
            <requestFiltering>
                <!-- Limit file uploads to 100MB -->
                <requestLimits maxAllowedContentLength="104857600" />
            </requestFiltering>
        </security>
    </system.webServer>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have developed a program that is counting the number of lines in a
I have developed a Java program that will count the number of files in
I have program that requires Python 3, but I develop Django and it uses
I have a program that reads from a file that grabs 4 bytes from
I have developed a java program that runs fine in Mac OS X (10.6.7).
I have a program developed for Windows XP, but when I try to install
I have a complex issue at hand. I have developed a program that takes
I have developed a C# script that opens an XLS file, parses it and
I have a program that needs to be developed. For confidentiality, I will use
I develop a Python-based drawing program, Whyteboard . I have tools that the user

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.