如何使用我的php代码访问linux服务器上不同用户权限的文件夹文件?

时间:2016-06-17 06:57:28

标签: php linux server directory access

我有一个场景,在http://somedomain.com/上我运行了我的代码,它基本上允许用户上传和下载文档。现在基本上需要的是,我希望无论用户上传什么,都应该在这条路径上传:  根/家庭/子文件夹/ myFoler /

我的代码基本上存在于此路径中 根/无功/网络/ HTML / somedomain.com /项目/

它在此路径上上传了用户文件: 根/无功/网络/ HTML / somedomain.com /项目/ Mymodule中/ user_space /

有人可以建议我如何从我的代码访问/ home / subfolder / myFoler /文件夹到服务器,以使我的用户文件安全? 如果有人可以就此向我提出任何建议,我深表感谢......

1 个答案:

答案 0 :(得分:0)

Suppose that you want to save files on path/to/save directory on your server, you can create ftp account for this directory.
then by following link will provide you a code which will connect you to that server directory and transfer the file

http://www.w3schools.com/php/func_ftp_put.asp

By this way you can secure your directory by making it accessible through credentials

i think this might help you