Is ASP.NET MVC the better choice over XMLHttpRequest?

I am utilizing angular-file-upload to upload a file in my AngularJS app.

There are two uploads:

  1. upload OK

Content-Length: 3515744

Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryBw0EMfNfB9biF4Kn

Content-Disposition: form-data; name="file"; filename="x.mp4"

Content-Type: video/mp4

  1. upload error 500

Content-Length: 4551690

Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryPW4QWcJZAlYPBOb6

Content-Disposition: form-data; name="file"; filename="y.mp4"

Content-Type: video/mp4

ExceptionMessage: "Sequence contains no elements" ExceptionType: "System.InvalidOperationException"

code

        var provider = new MultipartFormDataStreamProvider(root);

        var task = Request.Content.ReadAsMultipartAsync(provider).
            ContinueWith<HttpResponseMessage>(o =>
            {
                MultipartFileData file = (MultipartFileData)provider.FileData.First();
  1. request
provider.FileData.Count = 1
  1. request
provider.FileData.Count = 0

web.config

    <requestLimits maxAllowedContentLength="2147483647" />
    <fileExtensions>
       <add fileExtension=".mp4" allowed="true" />
    </fileExtensions>

Where can I adjust the limit?

Answer №1

It is my understanding that the upload limit can be set using the following code snippet,

<httpRuntime maxRequestLength="2147483647"/>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The problem lies in the execution of the $.getJSON function - the data is successfully converted from JSON to

My current task involves retrieving data from a json file hosted on a server, storing it in a global array, and then utilizing it in vue to iterate through the list. However, I am encountering an issue where even though the array is populated when printed ...

What is the best way to delete all tab items except for one in a wpf application?

One issue I'm facing is that when I click the logout button, I want to remove all tab items. Here's my current code: foreach (object item in mainTab.Items) { TabItem ti = (TabItem)item; if ("welcomeTabItem" != ti.Name) { mainTab.I ...

How can you retrieve newly added DOM elements from a PartialView using Ajax.BeginForm?

Below is a snippet of code that loads a Partial View within a div element: <div id="_customerForm"> @Html.Partial("~/Views/Customer/_customerForm.cshtml", Model.customerForm) </div> The Partial View contains an Ajax Form as shown ...

Adjusting the size of text in KineticJS to ensure it fits comfortably within a rectangle while

Check out this link: http://jsfiddle.net/6VRxE/11/ Looking for a way to dynamically adjust text, text size, and padding to fit inside a rectangle and be vertically aligned? Here's the code snippet: var messageText = new Kinetic.Text({ x: .25* ...

How to detect changes in Angular 2 using a separate service

Within my AuthService, I store real-time user data and a method for logging in. When the 'Login' button is clicked, the AuthService is called to retrieve updated user data from the server and update the value of 'this.user'. As a resul ...

Developing Reactive Selections with Material-UI is made easy

After spending about 5 hours on a task that I thought would only take 15 minutes, I still can't figure out the solution. The issue is with my React App where I have two dropdowns in the Diagnosis Component for users to select Make and Model of their a ...

Creating a Mongoose Schema to store geoJson coordinates

I attempted to design a schema for geojson but ran into some issues with the syntax when handling coordinates. This is my current code: var DataSchema = new Schema({ properties: { title: { type: String, required: true }, description: { ty ...

dynamically assigning a style attribute based on the dimensions of an image retrieved from a URL

My aim is to determine whether or not I should use an image based on its dimensions. To achieve this, I came across a function on stack overflow that can retrieve the dimensions of an image just by using its URL. Here is the code snippet they provided: f ...

Submitting data from a dropdown menu using Ajax in Struts 2: A step-by-step guide

I have a select tag with the s:select element inside a form. My goal is to send a post request to the specified action using Struts 2 json plugin. I do not have much knowledge in javascript or jquery. <s:form action="selectFileType" method="post" ...

AngularJS provides users with the ability to access additional information by matching specific identification

Is there a simple way in Angular to display the label of an item from an array without looping through it? I have an array of color options: $scope.colors=[ {id:"0",label:"blue"}, {id:"1",label:"red"}, {id:"2",label:"green"} ] And my data object store ...

Avoiding Webpack externals when using library components / fragments

Using Webpack has been a game-changer for us when it comes to writing isomorphic Javascript. It allows us to seamlessly switch between using npm packages on Node.js and utilizing browser globals during bundling. If I want to include the node-fetch npm pac ...

``There seems to be an issue with the functionality of ng-click

I am facing an issue with a ng-click function on a div tag. It works perfectly on desktop browsers, but when I try it on an iPad running iOS7, it does not work. Interestingly, changing the div to an a-tag makes it work. However, this is not a viable soluti ...

Angular 2: An Array of Objects

I've encountered an issue while trying to solve a problem in my code. I have a class called Device and a DeviceService for communication purposes. However, when I attempt to create an array of Device on the Scenes page, I keep encountering errors no m ...

Issues with integrating chart.js in Laravel 7: Element #app not found?

Currently, I am utilizing chart.js to display the statistics of reviews and messages for a user. However, I have encountered issues with the scripts. While the stats are functioning correctly, an error message stating Cannot find element: #app is appearing ...

Oops! An unexpected error occurred: TypeError - Seems like _this.searchElementRef is not defined

I recently implemented the Google Place API in my project by following this tutorial. However, I encountered the following error: ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'nativeElement' of undefined The issue seems ...

Learn how to efficiently redirect users without losing any valuable data after they sign up using localStorage

I am currently facing an issue with my sign up form. Whenever a user creates an account, I use localStorage to save the form values. However, if the user is redirected to another page after hitting the submit button, only the last user's data is saved ...

It is not possible to utilize a JavaScript function once the script has been loaded through

I am attempting to programmatically load a local JavaScript file - PapaParse library, and then utilize one of its functions: $.getScript("./Content/Scripts/papaparse.js", function () { console.log("Papaparse loaded successfully"); Papa.parse(file, ...

SQL for Year and Quarter Data Analysis

Is there a way to retrieve data from a SQL Table based on quarters and Years? Here is the format of my data: [![enter image description here][1]][1] Desired data [![enter image description here][2]][2] [1]: https://i.sstatic.net/gU2aO.png [2]: htt ...

Unable to install android application due to duplicated code

I created a hybrid app for Android using Ionic v1 and Angular 1 which is currently running smoothly. I have already uploaded it to the Play Store. Now, I have copied the same code to create a new app, changed the name and package path. However, I am facin ...

A guide on utilizing bootstrap tooltip feature to display information when hovering over an image

I have a jQuery function that dynamically creates an image and li element on the page. My goal is to implement a bootstrap tooltip so that when the mouse hovers over the image, additional details about it will be displayed in a separate tooltip similar t ...