Back to PhocacartFile class

Method createDownloadFolder

public static
createDownloadFolder
(mixed $folder)

Method createDownloadFolder - Source code

public static function createDownloadFolder($folder)
{
    $path = PhocacartPath::getPath('productfile');
    if (!Folder::exists($path['orig_abs_ds'] . $folder)) {
        if (Folder::create($path['orig_abs_ds'] . $folder, 0755)) {
            $data = "<html>\n<body bgcolor=\"#FFFFFF\">\n</body>\n</html>";
            File::write($path['orig_abs_ds'] . $folder . '/index.html', $data);
            return true;
        } else {
            return false;
        }
    }
    return true;
}