php文件夹0777,PHP代码mkdir(‘images’,’0777′)创建一个具有411权限的文件夹!为什么?...

我发誓这是昨天的工作.然而,现在下面的代码破坏文件夹没有问题,但创建一个具有411权限的新文件夹应该是777.我的代码昨天这样做.

这样做的目的是压缩文件夹,传递文件夹,删除图像,然后为图像创建新目录.

有人能告诉我我做错了什么或我应该做什么?谢谢

function delete_directory($dirname) {

if (is_dir($dirname))

$dir_handle = opendir($dirname);

if (!$dir_handle)

return false;

while($file = readdir($dir_handle)) {

if ($file != "." && $file != "..") {

if (!is_dir($dirname."/".$file))

unlink($dirname."/".$file);

else

delete_directory($dirname.'/'.$file);

}

}

closedir($dir_handle);

rmdir($dirname);

return true;

}

$directoryToZip="jigsaw/"; // This will zip all the file(s) in this present working directory

$outputDir="/"; //Replace "/" with the name of the desired output directory.

$zipName="jigsaw.zip";

include_once("createzipfile/CreateZipFile.inc.php");

$createZipFile=new CreateZipFile;

/*

// Code to Zip a single file

$createZipFile->addDirectory($outputDir);

$fileContents=file_get_contents($fileToZip);

$createZipFile->addFile($fileContents, $outputDir.$fileToZip);

*/

//Code toZip a directory and all its files/subdirectories

$createZipFile->zipDirectory($directoryToZip,$outputDir);

/*

$rand=md5(microtime().rand(0,999999));

$zipName=$rand."_".$zipName;

*/

$fd=fopen($zipName, "wb");

$out=fwrite($fd,$createZipFile->getZippedfile());

fclose($fd);

$createZipFile->forceDownload($zipName);

@unlink($zipName);

delete_directory('jigsaw/assets/images/jigsaw_image');

mkdir('jigsaw/assets/images/jigsaw_image','0777');

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值