设置下载路径 [英] Set download path

查看:87
本文介绍了设置下载路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Web应用程序接收一个简单的文本文件,但我需要这个文件被下载到一个特定的路径。意思是当应用程序接收到文本文件时,它将始终被下载到特定的文件夹(例如C:\MyFolder)。如果不可能,那么我需要将用户选择的文件复制到我的文件夹。



此应用程序基于JavaScript。

解决方案

JavaScript无法对我的(访问者)本地文件系统执行 我仍然完全控制我的下载文件去哪里,他们被命名,以及我是否甚至想要首先下载它们。



对不起,但是最好的方法是通知您的用户将您要提供的文件下载到哪里。您不能使用JavaScript自己选择目的地。


I have a web application that receives a simple text file, but I need this file to be downloaded to a specific path. Meaning, when the application receives a text file, it will always be downloaded to a specific folder (for example, to C:\MyFolder). If it isn't possible, then I need to copy the file from where user has chosen to my folder.

This application is based on JavaScript.

解决方案

JavaScript cannot exert any control over my (the visitor's) local filesystem. I remain in complete control of where my downloaded files go, what they are named, and indeed whether I even want to download them in the first place.

Sorry, but the best you can do is inform your users where to put the file you're offering for download. You cannot use JavaScript to choose the destination yourself.

这篇关于设置下载路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆