Why I got `Not allowed to load local resource` error on chrome when I use blob to load resource from ArrayBuffer?

前端 未结 1 470
既然无缘
既然无缘 2021-01-26 05:46

I need to load an image from ArrayBuffer. I saw some articles says using Blob is the most efficient way to make it.

This is the code I wrote to convert arraybuffer to bl

1条回答
  •  离开以前
    2021-01-26 06:24

    This is because chrome has some security reasons to not allowing access from file system.

    open the page which gets you error and check url.

    If it is something like:

    file:///C:/Users/desktopname/projectfolder//yourfile.html

    you see first word of url is file which means you are accessing file from file system and chrome / oprea are blocking your request.

    try to run your project on http://localhost/portnumber (This link you can get on running your project on framework of your choice. in my case, i am running on visual studio)

    ** I found this issue on chrome and opera web browsers. this working on mozila firefox and microsoft Edge.

    0 讨论(0)
提交回复
热议问题