Update: FileDialog download method
This commit is contained in:
@@ -9,16 +9,20 @@ function FileDialog(props) {
|
|||||||
|
|
||||||
let navigate = useNavigate();
|
let navigate = useNavigate();
|
||||||
|
|
||||||
|
const downloadURL = "/api/v1/get_file_direct?id=" + props.file.id;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<dialog open={props.showStatus}>
|
<dialog open={props.showStatus}>
|
||||||
<p>{props.file.filename}</p>
|
<p>{props.file.filename}</p>
|
||||||
<p>
|
<p>
|
||||||
Download 使用 Axios 异步下载
|
Download 使用浏览器下载原文件
|
||||||
<br />
|
<br />
|
||||||
Play 调用网页播放器播放
|
Play 调用网页播放器播放
|
||||||
<br />
|
<br />
|
||||||
</p>
|
</p>
|
||||||
<button>Download</button>
|
<a href={downloadURL} download>
|
||||||
|
<button>Download</button>
|
||||||
|
</a>
|
||||||
<button
|
<button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
props.setPlayingFile(props.file);
|
props.setPlayingFile(props.file);
|
||||||
|
|||||||
Reference in New Issue
Block a user