photo upload bei runs geht jetzt (beim ergebnis eintragen)
All checks were successful
Build and push / Pulling repo on server (push) Successful in 3s
All checks were successful
Build and push / Pulling repo on server (push) Successful in 3s
This commit is contained in:
@ -103,6 +103,25 @@ class Runs extends Page {
|
||||
$res->run = $rid;
|
||||
$res->user = $_SESSION['user']->id;
|
||||
|
||||
if($_FILES['photos'])
|
||||
{
|
||||
foreach($_FILES['photos']['tmp_name'] as $key => $tmp_name)
|
||||
{
|
||||
try{
|
||||
$url = pictShareFormValidateAndUpload($_FILES['photos'],$key);
|
||||
$res->data['photos'][] = $url;
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return partial('error.html', ['errorMessage' => 'Fehler beim Upload des Fotos: '.$e->getMessage()]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//filter out unique values so we don't have double entries
|
||||
$res->data['photos'] = array_unique($res->data['photos']);
|
||||
}
|
||||
|
||||
try{
|
||||
$resid = $res->save();
|
||||
|
||||
|
Reference in New Issue
Block a user