mirror of
https://github.com/WebStackPage/WebStackPage.github.io.git
synced 2026-02-07 12:23:39 +08:00
update
This commit is contained in:
25
data/upload-file.php
Executable file
25
data/upload-file.php
Executable file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
header('Content-Type: application/json');
|
||||
|
||||
#$errors = mt_rand(0,100)%2==0; // Random response (Demo Purpose)
|
||||
$errors = false;
|
||||
|
||||
|
||||
$resp = array(
|
||||
);
|
||||
|
||||
# Normal Response Code
|
||||
if(function_exists('http_response_code'))
|
||||
http_response_code(200);
|
||||
|
||||
# On Error
|
||||
if($errors)
|
||||
{
|
||||
if(function_exists('http_response_code'))
|
||||
http_response_code(400);
|
||||
|
||||
$resp['error'] = "Couldn't upload file, reason: ~";
|
||||
}
|
||||
|
||||
echo json_encode($resp);
|
||||
Reference in New Issue
Block a user