create folder in laravel

前端 未结 4 1625
迷失自我
迷失自我 2020-12-14 16:30

I have problem let user create folder in laravel 4 through ajax request > route > controller@method.
I did test ajax success request to the url call right method.
Wh

4条回答
  •  [愿得一人]
    2020-12-14 17:03

    There's multiple arguments you can use.

    You can create a directory using defaults.

    $result = File::makeDirectory('/path/to/directory');
    

    This will return true if directory was able to be created in the /path/to directory. The file mode of the created directory is 0777.

    You can specify the mode.

    $result = File::makeDirectory('/path/to/directory', 0775);
    

    This will return true if directory was able to be created in the /path/to directory. The file mode of the created directory will be 0775.

    You can also create the directories recursively.

    $result = File::makeDirectory('/path/to/directory', 0775, true);
    

提交回复
热议问题