Created
March 13, 2023 19:14
-
-
Save 0test/f498be433fad4fb3e1284ac21f53fd76 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
if ($uid && $files && isset($files['photo_file']) && $files['photo_file']['error'] === 0) { | |
$dir = 'assets/images/' . $uid . '/'; | |
$filename = $FormLister->fs->takeFileName($files['photo_file']['name']); | |
$ext = $FormLister->fs->takeFileExt($files['photo_file']['name']); | |
$filename = $modx->stripAlias($filename).'.'.$ext; | |
$filename = $FormLister->fs->getInexistantFilename($dir.$filename,true); | |
if ($FormLister->fs->makeDir($dir) && move_uploaded_file($files['photo_file']['tmp_name'],$filename)) { | |
$data['photo'] = $FormLister->fs->relativePath($filename); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment