简体   繁体   English

将txt文件保存在特定位置

[英]Save txt file in specific location

I have a recursive function which generates about 200.txt files. 我有一个递归函数,可生成约200.txt文件。 I am running this application on a local server. 我正在本地服务器上运行此应用程序。

Basically, the front end just has a file upload field, which you just choose a .csv, which it then generates all the .txt files from that, but rather than saving them on the wamp server, is it possible to save them in a specific location? 基本上,前端只有一个文件上传字段,您只需选择一个.csv,然后该字段就会从中生成所有.txt文件,但可以将它们保存在具体位置?

Example, if I put another field in my front end called 'fileLocation', and the user types in the pathname. 例如,如果我在前端放置了另一个名为“ fileLocation”的字段,并且用户键入了路径名。

Obviously i'd have to check if it's a directory etc, but is this possible to say save all the files on: 显然我必须检查它是否是目录等,但这是否可以说将所有文件保存在:

/Volumes/computer/Users/username/Desktop/test/

I'm not sure where to proceed with this. 我不确定在哪里继续进行。

No, is not possible to access computer files this way by using a localhost. 否,无法使用本地主机以这种方式访问​​计算机文件。 You could zip all files and make the browser download them. 您可以压缩所有文件并使浏览器下载它们。 Like is described here 这里描述得像

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM