HTML5 下载属性到所选文件夹 [英] HTML5 Download Attribute to Selected Folder
问题描述
我似乎无法弄清楚这一点.我写了一个 HTML5 脚本,我一直在自动下载到默认文件夹.
I cannot seem to figure this out. I wrote a HTML5 script and I keep getting auto download to default folder.
HTML5 代码:
<a href="../admin/gambar/<?php echo $row['file']; ?>" class="btn btn-success" role="button" download>
那么,先选择目标文件夹然后下载文件的代码是什么?
So, what code to select a destination folder first and then download the file ?
谢谢.
推荐答案
下载"的目的地由浏览器控制,您不能通过纯 JavaScript 代码修改甚至获取信息(暴露用户的文件系统信息是浏览器的安全风险),请阅读在不同位置下载文件使用HTML5
The destination of the 'download' is controlled by browser and you may not modify or even get the information via pure JavaScript code (exposing user's file system info is a security risk to browser), read more on Download A File At Different Location Using HTML5
假设有人将他的下载存储在 C:\CompanyName\RealName\PhoneNumber\Adress\
Imagine that one stores his downloads at C:\CompanyName\RealName\PhoneNumber\Adress\
这是一种自动下载文件到默认文件夹的浏览器行为,比如谷歌浏览器,你可以看到这篇帮助文章https://support.google.com/chrome/answer/95759?hl=en-GB&ref_topic=14681
This is a browser behavior that auto-download file to the default folder, like Google Chrome you could see this help article https://support.google.com/chrome/answer/95759?hl=en-GB&ref_topic=14681
这篇关于HTML5 下载属性到所选文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!