The issue of content type being changed when transferring files to Azure Blob container

I've encountered a problem in my code where Azure is overriding the content type with application/octet-stream instead of the expected image/png. Even though I can see in the network tab that the content type is set correctly, when viewing the file in the container, it reverts back to the default.

Just to mention, I am utilizing the npm package vue-azure-blob-upload

 http.put(uri, requestData,
        {
          headers: {
            'x-ms-blob-type': 'BlockBlob',
            'Content-Type': state.file.type,
            'x-ms-version': '2020-10-02',
            'x-ms-date': new Date(),
          },
          transformRequest: [],
        }).then(function (response) {
        $log(response);
         }

Within http.js:

init() {
    axios.defaults.headers.put['Content-Type'] = 'image/png';
},

https://i.stack.imgur.com/4Nj2w.png

Answer №1

Appreciation to Gaurav Mantri for the valuable input. Incorporating your suggestion into the answer for the benefit of our community.

Suggested modification: Replace the content-type header in the request with x-ms-blob-content-type

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

npm package.json scripts not executing

Whenever I try to run npm start or npm run customScriptCommand, npm seems to not be executing anything on my project and just quickly returns a new line in the terminal. I attempted to solve this issue by uninstalling node and npm from my machine, then in ...

Error: The property 'case sensitive routing' cannot be accessed because it is undefined

Task at hand: Running ExpressJS port using Node.js, nodemon, and lib. Operating System: Windows 10 Home x64 Node.JS Version: Lts The Challenge: Getting the ExpressJS port to run successfully. Current Issue: Encountering an internal file error, potentiall ...

What are the reasons for steering clear of using apt-get to install Node.js on Ubuntu?

What are the reasons for avoiding the installation of Node.js with apt-get on Ubuntu? And, how does utilizing curl and the nodejs PPA resolve this issue? (Tip: The issue is related to the ability to install npm modules globally. However, why should we even ...

Merge these two NPM packages together

Two npm projects exist: web-api (a library) and UI. The web-api utilizes gRPC-web to interact with the backend before converting it into a simple JavaScript object. In the UI, Vue.js is used in conjunction with web-api. Objective: merge these two project ...

The URL for the Javascript chunk includes colons at https://example.com/js/chunk-vendors.b3792e11.js:18:16400

I recently completed a Vue application and used npm run build to generate the files. Upon uploading the dist folder to my Apache server, I encountered an issue where Apache was unable to locate the file when trying to access a specific part of the app (:18 ...

The issue of broken images in the Azure Blob module for Drupal

Recently, I began constructing a Drupal website utilizing Azure. I successfully installed the Azure Blob module, and all functions worked flawlessly in my local environment, including image display and upload to storage blob. However, upon migrating the si ...

Steps for incorporating npm-check-update as a customized script in package.json file

Essentially, my code looks like this: "scripts": { "checkUpdate": "npm-check-updates", "updateConfig": "ncu-u" }, However, when I try to run npm checkUpdate, I receive the following output: where ...

Issue encountered when trying to use Node module in Electron application

I am currently in the process of developing an application that makes use of the node-bluetooth module from npm. However, I have encountered the following error: App threw an error during load Error: The module '/home/pi/AlucentOs/node_modules/node- ...

Combining package.json commands for launching both an Express server and a Vue app

I recently developed an application using Vue.js and express.js. As of now, I find myself having to open two separate terminal windows in order to run npm run serve in one and npm start in the other. My ultimate goal is to streamline this process and have ...

The NPM Install command is failing to download the required dependencies

My current challenge involves the installation of the Ushahidi V3 Client. I have diligently followed the provided installation guide up to the point where I am required to build the project from the source repository using npm and gulp. These tools are com ...

Incorporating personalized fonts into React webpack bundling

I've been working on a ReactJS component to be published on npmjs. I successfully added custom fonts as tff files using webpack, and they are displaying properly in the development mode. However, when switching to production mode, the fonts are not be ...

Installation of the rsuite package in React Suite is not successful

Encountered an error while trying to install the rsuite package (version 4.9.3) using the command: npm i rsuite I need some assistance with resolving this installation issue. Here is the error message that I received: npm ERR! code ERESOLVE npm ERR! ERESO ...

Issue with GitHub actions: NPM publishing encountering authentication error with code ENEEDAUTH

I have tried following the official guide for publishing and installing a package using GitHub Actions: Authenticating to package registries with granular permissions Encountered this error: npm ERR! code ENEEDAUTH npm ERR! need auth This command requires ...

What steps are necessary to deploy Firebase functions using GitHub actions?

Within my project, a structured folder system is in place that looks like this: dev-internal-web -.firebase -.github -e2e -functions -node_modules -src (misc files) One specific folder I have is named functions, and it contains firebase functions. I aim t ...

Retrieving and saving images from Azure Blob Storage

I need help with exporting matplotlib plots from Databricks to Blob Storage. Currently, I am using the following code: plt.savefig('/dbfs/my_plot.png') dbutils.fs.cp('dbfs:my_plot.jpg', blob_container) However, the issue arises when I ...

Encountering an error while attempting to run a 'npm install' command

I currently have npm version 6.13.4 installed on my system, however, when I use the "npm install" command, I encounter an error message as shown below. Any advice on how to resolve this would be greatly appreciated. gyp ERR! build error gyp ERR! stack E ...

building responsive servers within Gulp using connect

Can I validate the availability of a server port before creating it using Gulp? Currently, this is my approach: /** * Start LiveReload Server */ gulp.task('connect', function() { var connect = require('connect'), app = ...

Encountering a 404 error when trying to access a private repository following the addition of a personal access token to the

Uncertain about the reason behind this issue. Receiving a Request failed \"404 Not Found\"" I have generated the token in my github settings, configured the proper repository permissions for the token, and then included it in my . ...

The term 'Buffer' is not recognized in the context of react-native

Having trouble using buffer in my react-native app (developed with the expo tool). I have a hex value representing a geography Point like this for example -> 0101000020E61000003868AF3E1E0A494046B3B27DC8F73640 and I'm attempting to decode it into l ...

Steps to resolve the 'aws-cdk command not found' error post npm install

I'm currently in the process of setting up the aws-cdk on my system. I entered the command npm install -g aws-cdk into the terminal as instructed here. After npm completes the installation, the following output is displayed: /usr/local/Cellar/node/9. ...