1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2025-06-25 19:37:23 +02:00

Phase 3 : réponse aux questions

This commit is contained in:
galaxyoyo
2019-09-21 20:39:40 +02:00
parent ac48412f7e
commit 5355ba87b1
9 changed files with 261 additions and 22 deletions

View File

@ -36,21 +36,7 @@ else {
$to = Team::fromId($question->getTo());
$mime_type = finfo_file(finfo_open(FILEINFO_MIME_TYPE), "$LOCAL_PATH/files/$id");
$name = "Pièce jointe n°" . $question->getNumber() . " de l'équipe " . $from->getTrigram() . " pour l'équipe " . $from->getTrigram() . " (problème " . $question->getProblem() . ")";
switch ($mime_type) {
case "application/pdf":
$name .= "pdf";
break;
case "image/png":
$name .= ".png";
break;
case "image/jpg":
case "image/jpeg":
$name .= ".jpg";
break;
case "application/zip":
$name .= ".zip";
break;
}
$name .= getExtFromMimeType($mime_type);
header("Content-Type: " . $mime_type);
}
else