new database
This commit is contained in:
@@ -13,15 +13,15 @@ function ZipFileHandler(string $gameFileName, string $gameFileTmp): string
|
||||
$headerType = mime_content_type($gameFileTmp);
|
||||
$headerTypeMatch = array('application/zip');
|
||||
|
||||
if(in_array($headerType,$headerTypeMatch)){
|
||||
$gameFileNewName = uniqid("", true). "." . $fileActualExtGame;
|
||||
if(empty($gameFileName)){
|
||||
if (in_array($headerType, $headerTypeMatch)) {
|
||||
$gameFileNewName = uniqid("", true) . "." . $fileActualExtGame;
|
||||
if (empty($gameFileName)) {
|
||||
http_response_code(400);
|
||||
exit();
|
||||
}
|
||||
rename($gameFileTmp,"../../Games/".$gameFileNewName);
|
||||
rename($gameFileTmp, "../../Games/" . $gameFileNewName);
|
||||
return $gameFileNewName;
|
||||
}else{
|
||||
} else {
|
||||
http_response_code(400);
|
||||
echo json_encode(["message" => "Wrong file type gameFile"]);
|
||||
exit();
|
||||
@@ -39,17 +39,17 @@ function imagesFileHandler(string $thumbnailFileName, string $thumbnailFileTmp):
|
||||
$fileActualExtThumb = strtolower(end($fileExtThumb));
|
||||
|
||||
$headerType = mime_content_type($thumbnailFileTmp);
|
||||
$headerTypeMatch = array('image/png', 'image/jpeg','image/gif', 'image/svg+xml',);
|
||||
$headerTypeMatch = array('image/png', 'image/jpeg', 'image/gif', 'image/svg+xml',);
|
||||
|
||||
if(in_array($headerType,$headerTypeMatch)){
|
||||
$thumbnailFileNewName = uniqid("", true). "." . $fileActualExtThumb;
|
||||
if(empty($thumbnailFileName)){
|
||||
if (in_array($headerType, $headerTypeMatch)) {
|
||||
$thumbnailFileNewName = uniqid("", true) . "." . $fileActualExtThumb;
|
||||
if (empty($thumbnailFileName)) {
|
||||
http_response_code(400);
|
||||
exit();
|
||||
}
|
||||
rename($thumbnailFileTmp,"../../../Frontend/images/".$thumbnailFileNewName);
|
||||
rename($thumbnailFileTmp, "../../../Frontend/images/" . $thumbnailFileNewName);
|
||||
return $thumbnailFileNewName;
|
||||
}else{
|
||||
} else {
|
||||
http_response_code(400);
|
||||
echo json_encode(["message" => "Wrong file type thumbnailFile"]);
|
||||
exit();
|
||||
|
||||
Reference in New Issue
Block a user