cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MIME type ('text/plain') is not executable

MIME type ('text/plain') is not executable

kostas k.7
Explorer | Level 4
Go to solution

Hello Dropboxers,

 

I am developing a web app with the use of HTTP endpoints. Thus far, the Power user(owner of a file) can create_a_shared_link with settings for a specific file and share it with others. When a Guest user (NOT owner of the file) logs in to my app i grab the shared link ( that was provided ), i replace the www.dropbox.com/s/blablabla/myFile with  dl.dropboxusercontent.com/s/blablabla/myFile and i create a dymanic Javascript script with src="The shared link" to download the file and read it's response. 

 

When the script is placed in the HTML an error occurs:   "Refused to execute script from 'dl.dropboxusercontent.com/s/blablabla/myFile' because its MIME type ('text/plain') is not executable, and strict MIME type checking is enabled."

 

I can not find a solution to this problem. Can you provide some help please?

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution
Based on the output you shared, the browser is refusing to load the file as a script because the Content-Type returned isn't an executable type.

The Content-Type that Dropbox returns is based on the file extension. It sounds like you probably have a plain text extension on the file, e.g., ".txt". You would need to switch to using ".js" as the file extension in Dropbox if you want it to be served as "application/javascript" instead, so that the browser will load it.

View solution in original post

1 Reply 1

Greg-DB
Dropbox Staff
Go to solution
Based on the output you shared, the browser is refusing to load the file as a script because the Content-Type returned isn't an executable type.

The Content-Type that Dropbox returns is based on the file extension. It sounds like you probably have a plain text extension on the file, e.g., ".txt". You would need to switch to using ".js" as the file extension in Dropbox if you want it to be served as "application/javascript" instead, so that the browser will load it.
Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?