added file uploads
This commit is contained in:
@@ -2008,6 +2008,11 @@ class PreorderController extends mfBaseController {
|
||||
|
||||
foreach ($_FILES['files']['name'] as $index => $name) {
|
||||
if ($_FILES['files']['error'][$index] !== UPLOAD_ERR_OK) continue;
|
||||
$extension = pathinfo($name, PATHINFO_EXTENSION);
|
||||
$name = preg_replace('/[^a-zA-Z0-9_-]/', '_', substr($descriptions[$index], 0, 50));
|
||||
if ($extension) {
|
||||
$name .= '.' . $extension;
|
||||
}
|
||||
|
||||
$_FILES['file'] = [
|
||||
'name' => $name,
|
||||
|
||||
Reference in New Issue
Block a user