What is the best way to process the bytes from xhr.responseText?

Is there a way to successfully download a large 400+ mb Json file using xmlhttprequest without encountering the dreaded Ah Snap message in Chrome due to its immense size?

One potential solution I've considered is implementing setInterval() to read the response text incrementally as it streams. However, I am unsure of how to effectively consume this data after each call to setInterval.

Alternatively, would utilizing a different web protocol entirely be a more viable option for handling such a large file?

Answer №1

To optimize file handling, it may be beneficial to split the file into smaller segments or consider a server-side solution that sends portions of the file at a time. Different browsers have varying limitations on file size capacity, typically ranging from 40Mb to 100Mb rather than 400Mb and above.

I came across a resource: which discusses a technique for simulating streaming text using xhr. However, it notes that this method may be slow and may not align with your specific needs.

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

Ensuring React's setupProxy functions properly in conjunction with express.js

I've encountered an issue while trying to pass images from express to react. My express.static is correctly set up, so when I visit localhost:5000/public/images/me.jpeg, the image loads in my browser. However, when I attempt to use <img src="/publi ...

Content from ajax request is invalid

Currently, I am facing an issue with loading a comment list and replacing the existing list on my HTML page with the new one. Previously, I used to load a simple XML list, iterate over its elements, and generate content. Although this method worked fine, i ...

Render data from a RESTful Express API using AJAX and Node.js to display on a webpage

New to node.js development and facing a specific issue. My goal is to build a single-page web app using node.js where users can submit request data, retrieve information from the IMDb API, and display it on the same page. Here's my code: server.js # ...

Enhancing Website Interactivity with PHP, AJAX, and

I recently followed a tutorial on handling AJAX requests with PHP and MySQL, which can be found here. My goal is to update the SQL query based on the value selected from a dropdown menu using the onchange event. function myfunctionTime(time) { if (t ...

What is the best way to make multiple HTML tables sortable?

I recently implemented an open-source JavaScript table sorter in my project. You can find more information about it here: However, I encountered an issue where only the most recently added table on my page is sortable. When users press a button, new table ...

Making asynchronous requests to a web API endpoint using Ajax

I'm currently working with the following view structure : <div id="addDisplay" class="display"> <div class="box-header"> <h3 class="box-title">Ajouter un compte</h3> </di ...

The process of converting JSON data into its original form

I need assistance in deserializing this JSON data. I am using Newtonsoft for the deserialization process: This is a snippet of how my JSON looks: [ { "CUSTOMER":{ "CUSTOMERNO":"ABC123", "BUSINESSAREA":"A", "FIRSTNAME":"B ...

saving a JSON element in a JavaScript array

Currently, I am utilizing AJAX to fetch data from a database using PHP and then converting it into JSON format. <?php echo json_encode($data); ?> This is the AJAX function being used: ajaxCall("getdata.php", container, function (data) { var co ...

``Is there a reason why JavaScript/jQuery events are not functioning properly within a PHP foreach

Although I have a good understanding of foreach loop in PHP, I am facing a new challenge where the script within the foreach loop only works for the first item. This is puzzling to me and I'm trying to figure out why. In my code, I am retrieving an i ...

Unable to trigger onSelect event on the datepicker component

Whenever a date is chosen, I need to trigger a javascript function. Here is the javascript code: $(document).ready(function(){ var date_input=$('input[name="date"]'); //our date input has the name "date" var container=$('.bootstrap- ...

Display the current language in the Vue language dropdown

My component is called DropdownLanguage.vue Goal: I need to show the current active language by default in the :text="selectedOptionDropdown" attribute. For example, it should display "English" which corresponds to languages.name. I'm struggling with ...

What steps should I take to adjust the price when multiple items are chosen?

I am working on a school project that requires JavaScript programming assistance. You can view the code here: https://jsfiddle.net/zvov1jpr/3/ HTML: <script src="java.js"></script> <div id="formular"> <div id=&qu ...

What could be causing my LESS files not to compile properly in grunt?

I've successfully installed npm and ran npm init. Additionally, I've installed the following packages using npm: grunt grunt-contrib-less grunt-contrib-watch jit-grunt --save-dev My Gruntfile.js configuration looks like this: module.exports = f ...

Is there a way to continuously update my page using Ajax within an MVC framework?

I am looking to implement a feature on my webpage that updates the table data every second using Ajax. Any suggestions on how I can achieve this? ...

What is the best way to generate a JSON object with Angular and showcase its content through HTML?

Currently, I am dealing with a JSON object that is completely unfamiliar to me. Without knowing the keys or values of this object, I was able to successfully manipulate it and extract the necessary information. Ultimately, I have generated an array (whic ...

Formik Fields with unique key properties

When mapping text fields, I follow this structure: { AddVehicleFields.map(({formikRef, ...input}) => ( <> <TextField key={formikRef} helperText={ getIn(formik.touched, formikRef) ? getIn(formik. ...

Is it possible to resize an object using JavaScript?

Is it possible to change the size of an object when loading specific data by clicking on navigation? <object id="box" width="250" height="250" data=""></object> Although the JS code loads the data, it does not change the size. document.getEl ...

Enhance your images with the Tiptap extension for customizable captions

click here for image description I am looking to include an image along with an editable caption using the tiptap extension Check out this link for more information I found a great example with ProseMirror, but I'm wondering if it's possible ...

Modify every audio mixer for Windows

Currently working on developing software for Windows using typescript. Looking to modify the audio being played on Windows by utilizing the mixer for individual applications similar to the built-in Windows audio mixer. Came across a plugin called win-audi ...

My React application is being loaded by Express regardless of the route I access. What could be causing this issue?

I'm struggling to access the json data located at /species because express always seems to load the react app regardless of the route I use. Can someone help me identify the issue? Here is an excerpt from my server.js file: const app = require(' ...