亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

javascript - js plugin reads local files
PHP中文網(wǎng)
PHP中文網(wǎng) 2017-06-12 09:33:01
0
4
1282

I want to write a jq plug-in that allows the user to select a local file and then read the file. How can I select the file and then read it directly or get the absolute path? Both are acceptable.
However, after searching for a long time, I found that the absolute path problem is difficult to obtain due to security issues. Please provide solutions.

PHP中文網(wǎng)
PHP中文網(wǎng)

認(rèn)證高級PHP講師

reply all(4)
阿神

If you just want to read the file content for processing, you don’t need to know the local address. You only need to use the File API of html5. If you want to display something through the address, you should upload it to the background and return a network address.

You can check out my detailed summary:
Advanced JavaScript Learning (3) - File Operations Based on HTML5 File API

淡淡煙草味

is not because the absolute path problem is difficult to get due to security issues, so change is difficult to impossible .

typecho

Getting the local path is not possible, you can look at the File API

三叔

Upload to the background for parsing and then send it back to the front-end. The front-end js cannot read the file content directly

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template