1. Use a label to upload files
(1) Create a tag, add the download attribute to the tag, add the address of the tag, that is, the file download path, here use the template string concatenation method, oresult. fileUrl is a file address, followed by the file name, execute the click method of the tag a
Var a = document.createElement('a') a.setAttribute('download',' system admin ') a.setattribute ('href', '/file/getfile.do? path=${oResult.fileUrl}&name=${XXX.name}`) a.click()Copy the code
2. The second method uses the Open method of Windows
window.open(`/file/getfile.do? path=${oResult.fileUrl}&name=${XXX.name}`)Copy the code
PS: xiao Bai a, for download is also just contact for a few days, after a deeper insight in the update.