簡體   English   中英

如何使用我的php代碼訪問Linux服務器上具有不同用戶權限的文件夾的文件?

[英]How can I access the files of folder of different user permissions on linux server with my php code?

我有一個場景,在http://somedomain.com/上運行了我的代碼,該代碼基本上允許用戶上載和下載文檔。 現在基本上需要的是,我希望無論用戶上傳了什么,都應該在以下路徑上上傳:root / home / subfolder / myFoler /

我的代碼基本上存在於此路徑root / var / www / html / somedomain.com / project /

並從現在開始在以下路徑上上傳用戶文件:root / var / www / html / somedomain.com / project / myModule / user_space /

有人可以建議我如何從我的代碼訪問/ home / subfolder / myFoler /文件夾到服務器中,以確保我的用戶文件安全? 我非常感謝有人可以建議我……。

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM