将图像文件存储在动态创建的文件夹

时间:2015-07-21 06:17:12

标签: php image file upload directory

我想将图像文件及其路径存储在变量中,然后将此文件存储在我使用mkdir()创建的文件夹中。

这是我的文件夹创建代码:

<?php
$dirPath = "../leothian/jomres/uploadedimages/new_images2";
$result = mkdir($dirPath, 0777);
if ($result == 1)
{
    $dirPath = "../leothian/jomres/uploadedimages/new_images2/property";
    $result1=mkdir($dirPath,0777);
    if($result1=1)
    {
    $dirPath = "../leothian/jomres/uploadedimages/new_images2/property/0";
    $result2=mkdir($dirPath,0777);
    if($result2)
    {
        $dirPath = "../leothian/jomres/uploadedimages/new_images2/property/0/medium";
        $result3=mkdir($dirPath,0777);
    }
    $dirPath = "../leothian/jomres/uploadedimages/new_images2/slideshow";
    $result4=mkdir($dirPath,0777);
        if($result4=1)
        {

        $dirPath = "../leothian/jomres/uploadedimages/new_images2/slideshow/0";
        $result5=mkdir($dirPath,0777);


        }
    }
echo "Folders Created Sucessfully";
} 
else 
{
    echo "Error Creating Folders";
}
?>     

0 个答案:

没有答案