Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要授予访问我的 php 站点的所有本地计算机的临时文件夹(如果没有)的写权限。可以使用PHP吗?
不,你不能,因为 PHP 只能在服务器端工作!PHP 用于创建 HTML 输出,无法访问客户端机器上的文件。
chmod('路径/到/我的/文件夹',777); 只会更改服务器机器上的文件权限 - 永远不会在客户端上!
您可以使用 php 函数 chmod。你当然要小心,但你可以说
chmod('/path/to/my/folder',777);
或者你想要的任何写权限。
http://php.net/manual/en/function.chmod.php