Created
October 24, 2019 13:22
-
-
Save sidor1989/e6fb9c47f01706a96492c8bec1e77167 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
$info = new SplFileInfo($step_details[1]); // подставляю путь файла и узнаю его инфу | |
$ext = '.'.pathinfo($info->getFilename(), PATHINFO_EXTENSION); | |
$file = $name.$ext; | |
if( file_exists( DIR.$file ) && !file_exists( DIR.$name.$key.$ext )) // проверки на существующие файлы | |
$file = $name.$key.$ext; | |
else | |
$file = $name.($key+1).$ext; | |
save_img( DIR.$file, $step_details[1]); // сохраняю файл на сервере | |
$arFile = CFile::MakeFileArray( DIR.$file ); // создаю новый | |
$arFile['del'] = 'Y'; // метка удаления временного | |
$arFile['MODULE_ID'] = 'main'; | |
$fid = CFile::SaveFile($arFile, 'recipes'); | |
(int) $fid ? $img_steps[$key] = (int) $fid : ''; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment