Recently, a website has a function that allows users to preview the image to be uploaded in real time and select one of the images as the main image. I first thought of getting the value of the inputfile box through js.
Recently, a website has a function that allows users to preview the image to be uploaded in real time and select one of the images as the main image. I first thought of getting the value of the input file box through js, but unfortunately, in order to protect the data on the user's hard disk, the obtained path is as follows, some of them have been replaced by browsers, so the paths cannot be obtained. However, many high people still get this value through other methods. There are a lot of code on the Internet, but few of them are actually usable, and many of them are outdated. Below is the code I found from the Internet. After a slight transformation, the multi-chart preview is supported. Compatible with ie, Firefox, 360, and other browsers.