[英]How can I access a local file by giving the local file path using HTML/JS/Jquery?
Let's say I've csv file in my C:/test/tes.csv and I've a text box in html file and paste the above path in text box. 假设我在C:/test/tes.csv中有一个csv文件,在html文件中有一个文本框,并将上面的路径粘贴到文本框中。 I've "Load Data" button near by the textbox.
我在文本框附近有“加载数据”按钮。 when I click on the button I want to alert the content of the file.
当我单击按钮时,我想提醒文件内容。 Insted of default file picker in HTML/JS, there is anyway to load the data?
安装了HTML / JS中的默认文件选择器后,是否仍要加载数据? I want to use it in my application.
我想在我的应用程序中使用它。
Please help me to figure out it 请帮我弄清楚
You should try and use the FileReader API , which allows you to read the contents of files (or raw data buffers) stored on the user's computer. 您应该尝试使用FileReader API ,它使您可以读取存储在用户计算机上的文件(或原始数据缓冲区)的内容。
Eric Bidelman wrote this awesome article that can help you get started. 埃里克·比德尔曼(Eric Bidelman)撰写了这篇很棒的文章 ,可以帮助您入门。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.