删除文件夹中的只读权限,以便在目标文件夹中上载文件(php)

时间:2022-08-28 10:28:23

I have a php script to upload file to a folder in my locahost. The folder permission is read only. I belive that is the reason why file is not getting uploaded. I tried changing the permission using following commands,

我有一个PHP脚本将文件上传到我的locahost中的文件夹。文件夹权限是只读的。我相信这就是文件没有上传的原因。我尝试使用以下命令更改权限,

attrib -r c:\wamp64\*.* /s

attrib -r +s c:\wamp64\www\ProjectName\platform\tabs\uploads

But the folder is still read only. I cannot figure what can be the issue other than this that upload is not working. Any suggestions are helpful. The same code works fine on other server, but not on localhost. uploads folder in server has all permissions.

但该文件夹仍然是只读的。除了这个上传不起作用之外,我无法确定可能存在的问题。任何建议都有帮助。相同的代码在其他服务器上运行正常,但在localhost上运行不正常。 server中的uploads文件夹具有所有权限。

1 个解决方案

#1


0  

Under Windows, the command ATTRIB is generally used to change permissions on files... not on folders. If you want to change the folder permissions, you have to use CACLS or ICACLS as follows:

在Windows下,命令ATTRIB通常用于更改文件的权限...而不是文件夹。如果要更改文件夹权限,则必须使用CACLS或ICACLS,如下所示:

CACLS "C:\wamp64\www\ProjectName\platform\tabs\uploads" /e /p MyUsername:F
ICACLS "C:\wamp64\www\ProjectName\platform\tabs\uploads" /grant MyUsername:F

#1


0  

Under Windows, the command ATTRIB is generally used to change permissions on files... not on folders. If you want to change the folder permissions, you have to use CACLS or ICACLS as follows:

在Windows下,命令ATTRIB通常用于更改文件的权限...而不是文件夹。如果要更改文件夹权限,则必须使用CACLS或ICACLS,如下所示:

CACLS "C:\wamp64\www\ProjectName\platform\tabs\uploads" /e /p MyUsername:F
ICACLS "C:\wamp64\www\ProjectName\platform\tabs\uploads" /grant MyUsername:F