Added http response code
This commit is contained in:
@@ -15,13 +15,14 @@ function ZipFileHandler(string $gameFileName, string $gameFileTmp){
|
||||
if(in_array($headerType,$headerTypeMatch)){
|
||||
$gameFileNewName = uniqid("", true). "." . $fileActualExtGame;
|
||||
if(empty($gameFileName)){
|
||||
header("location: ../../../Frontend/index.html?error=emptyFile");
|
||||
http_response_code(400);
|
||||
exit();
|
||||
}
|
||||
rename($gameFileTmp,"../../Games/".$gameFileNewName);
|
||||
return $gameFileNewName;
|
||||
}else{
|
||||
header("location: location: ../../../Frontend/index.html?error=Wrong%20File%20Type");
|
||||
echo "Wrong file type";
|
||||
http_response_code(400);
|
||||
exit();
|
||||
}
|
||||
return NULL;
|
||||
@@ -42,13 +43,14 @@ function imagesFileHandler(string $thumbnailFileName, string $thumbnailFileTmp){
|
||||
if(in_array($headerType,$headerTypeMatch)){
|
||||
$thumbnailFileNewName = uniqid("", true). "." . $fileActualExtThumb;
|
||||
if(empty($thumbnailFileName)){
|
||||
header("location: ../../../Frontend/index.html?error=emptyFile");
|
||||
http_response_code(400);
|
||||
exit();
|
||||
}
|
||||
rename($thumbnailFileTmp,"../../../Frontend/images/".$thumbnailFileNewName);
|
||||
return $thumbnailFileNewName;
|
||||
}else{
|
||||
header("location: location: ../../../Frontend/index.html?error=Wrong%20File%20Type");
|
||||
echo "Wrong file type";
|
||||
http_response_code(400);
|
||||
exit();
|
||||
}
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user