macos mac上的桌面路径
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6731566/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Desktop path on mac
提问by vks
I want create a file on the desk top of client mac machine from my website.but the desktop path is changed based on the user.How i get machine desk top pathe from my website.
我想从我的网站在客户端 mac 机器的桌面上创建一个文件。但是桌面路径是根据用户更改的。我如何从我的网站获取机器桌面路径。
In mac desktop path is like /Users/username/Desktop, but the username is changed by machine to machine.
在mac桌面路径类似于/Users/username/Desktop,但用户名由机器更改为机器。
回答by CharlesB
If you want to put a file on the user's desktop, there's no other way than have him download it. You can't access the filesystem, this is a basic security thing.
如果您想将文件放在用户的桌面上,除了让他下载之外别无他法。你不能访问文件系统,这是一个基本的安全问题。