Transferring Client Files to Azure Blob Storage using MVC Framework

After setting up a WebApp(MVC4) with a file upload feature, I made a major error by allowing clients to upload files directly to my server (Virtual Machine Azure).

To make this work, I adjusted the following settings in my WebConfig:

  1. maxRequestLength="2097151"
  2. executionTimeout="3600"
  3. maxAllowedContentLength="4294967295"

Now I realize this is not the correct approach.

Instead, I want users' files to be uploaded directly to my Azure Blob Storage without passing through my website.

While I have managed to upload files to my storage using C#, I want to avoid sending the files to the server first and then moving them to the blob storage, especially since I am dealing with very large files.

I am seeking a solution to transfer files to the blob storage without involving the server in the process.

How can I achieve this? I have not found many resources addressing this specific issue, except for mentions of SAS and CORS, which can help but lack clear guidelines to follow.

Answer №1

Utilizing CORS and SAS is the recommended approach for achieving this. I suggest delving into the details with the article on Generating and Utilizing a SAS with the Blob Service for a comprehensive overview. Additionally, check out our demonstration at the Build 2014 event for a hands-on application showcasing blob listing and downloading in JavaScript with CORS and SAS.

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

Using AJAX to Query a PHP Database

Currently, I am implementing an AJAX call from the YouTube player JavaScript to a PHP page that contains various functions, mainly involving database inserts. In my PHP code, I use a case statement to determine which function is being called based on the d ...

Tips for dynamically adding an HTML element to index.html using JavaScript

https://i.sstatic.net/cAna8.png How can I use JavaScript to insert cards into a container or display them in flex? Currently, the cards are not displaying as desired. I attempted to insert data into the note class using insertAdjacentHTML in JavaScript, b ...

Checking the list box and radio button using JavaScript based on their respective IDs

Looking to validate the selection of a listbox and radio button using their respective IDs when a submit action occurs. When testing in the browser, no alert is being displayed. The goal is to trigger the script upon clicking the submit button to verify ...

npm ERROR! 404 Content removed by unidentified source on August 8, 2022 at 09:20:35.527 UTC

Upon running the command <npm view e-biz-znnf versions --json> in the terminal, npm throws an error message: npm ERR! code E404 npm ERR! 404 Unpublished by undefined on 2022-08-08T09:20:35.527Z npm ERR! 404 npm ERR! 404 'e-biz-znnf' is no ...

What steps are involved in creating a default toolbar for a material picker in a React application?

Looking for assistance with customizing the toolbar for material picker (v3) by adding a title inside the dialog. I successfully implemented this in the KeyboardDatePicker following a helpful thread (https://github.com/mui-org/material-ui-pickers/issues/11 ...

Transmit information from a Chrome extension to a Node.js server

Recently, I developed a basic Chrome extension that captures a few clicks on a specific webpage and stores the data in my content_script. Now, I am looking for ways to transmit this data (in JSON format) to my node.js file located at /start. I am seeking ...

Is there a way to use node.js to retrieve a video in mp4 format?

My goal is to allow users to download a video from my AWS S3 bucket in MP4 format: app.get("/download_video", function(req,res) { filename = "s3.xxx.amazon.com/bucketname/folder/video_example.mp4"; // I'm unsure about the next steps }); Whil ...

There are certain issues with the code on various aspects, particularly with the ajax and php code

Looking for assistance with my ajax code. I am encountering a couple of issues: (1) When I try to add if(isset) on action, data is not being inserted into the database; it works fine without it. My requirement is to make it work with if(isset). (2) The suc ...

Guide on transmitting two multidimensional arrays using json_encode in PHP

When working with Laravel PHP, I am trying to retrieve arrays for my ajax function using json_encode. The issue I am facing is that I need to send two multidimensional arrays from my controller in order to perform nested loops inside my ajax function using ...

Is there a glitch in the three.js loadOBJMTL loader?

Encountering an issue with the OBJMTL loader in three.js. I'm working with obj/mtl/jpeg files and getting load errors that look like this: "THREE.OBJMTLLoader: Unhandled line 4033/5601/6659" OBJMTLLoader.js:347 Seems like there is a problem with a c ...

Focus on all of the individual items except for the one that was just selected

Within the function thirdNavFunction, I am seeking a way to specifically target all instances of the .third-nav classes, excluding the one that has been clicked on. This must be accomplished without utilizing jQuery. How can I achieve this? var thirdNav = ...

Developing a countdown timer with an initial value set by the user in an input field

Whenever I click the button, the countdown only advances by one digit before stopping. It seems that the countdown is reverting to the initial value entered in the input box. My goal is to have the initial value entered in the input field set as the starti ...

Manipulating global state properties within a reducer function in React: How to do it efficiently

I am looking to implement a single loader (backdrop and spinner) within my app component that can be displayed based on the value of a property in the Redux state called showLoader. This loader should be accessible throughout my entire React application. T ...

Functional Components with Methods in ReactJS

When creating a functional stateless component that requires methods to access props, is there a recommended approach or best practice to follow? For instance: function Stateless(props) { function doSomething(props) { console.log(props); } ...

Distinguishing Jquery and Ajax

Could someone kindly provide a comparison of the distinctions between Jquery and Ajax? ...

Combining various JSON objects by nesting them together

I'm in the process of creating an endpoint where I need to combine data from four different tables into one nested object. Each table record is retrieved in JSON format using sequelize - they include information on location, service, staff, and tenant ...

Monitoring page reload with JavaScript

Here is an example of tabbed content: <div class="tab"> <button class="tablinks" onclick="openCity(event, 'NewYork')" id="defaultOpen">New York</button> <button class="tablinks" onclick="openCity(event, 'LosAngeles& ...

Loop through JSON data using jQuery for parsing

Here is the code snippet I have included below, which is a part of a larger code base: <html> <head> <style> #results{margin-top:100px; width:600px; border:1px solid #000000; background-color:#CCCCCC; min-height:200px;} </style> & ...

Bypassing 403 error in redux and react application

It appears that Redux or express is failing to handle an error scenario where a user updates their password using a reset password link token. https://i.sstatic.net/uo7ho.png https://i.sstatic.net/WGHdt.png An error message should be displayed as follow ...

If the text is too lengthy, enclose it within a div element

I am facing an issue with a fixed width DIV of 300px. Within this DIV, I have dynamic text that sometimes exceeds the width and gets cut off. Is there a way to make the text wrap when it exceeds the 300px limit without increasing the height of the DIV? Is ...