運用File、FileList和FileReader三個Web API,我們可以透過網頁上的元素獲取使用者選取的檔案。
由<input>標籤獲得檔案
假設現在有這個很陽春的網頁:
<!DOCTYPE html>
<html>
<body>
<input id = "input" accept = ".xml" type = "file">讀我</input>
<p id = "result"></p>
Are you sure to leave this team?
Once you delete your team, all team notes will be deleted and cannot be recovered. Please ensure you've exported or transfered these notes.
Enter team name before deleting it:
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up