How to load images from the local machine to JS object avoiding loading to the server

前端 未结 3 696
清歌不尽
清歌不尽 2020-12-16 04:31

I want to load an image file from the computer directly to any js object without using any server-side component. For example, I want to select a picture from the local mach

3条回答
  •  不知归路
    2020-12-16 05:17

    You can use createObjectURL method of the window.URL object, this doesn't have much browser support though

    http://jsfiddle.net/LvAqp/ only works in chrome and firefox

提交回复
热议问题