diff --git a/apis/index.php b/apis/index.php index e658411..984fca4 100644 --- a/apis/index.php +++ b/apis/index.php @@ -1,55 +1,40 @@ 'success','message' => $file))); } } - -// Upload Signature -if(isset($_FILES['Signature'])){ - echo "alert('Working!')"; - $errors= array(); - $file_name = $_FILES['Signature']['name']; - $file_size =$_FILES['Signature']['size']; - $file_tmp =$_FILES['Signature']['tmp_name']; - $file_type=$_FILES['Signature']['type']; - $tmp = explode('.',$_FILES['Signature']['name']); - $file_ext=strtolower(end($tmp)); - - $extensions= array("jpeg","jpg","png"); - - if(in_array($file_ext,$extensions)=== false){ - $errors[]="extension not allowed, please choose a JPEG or PNG file."; - } - - if($file_size > 2097152){ - $errors[]='File size must be exactely 2 MB'; - } - - if(empty($errors)==true){ - move_uploaded_file($file_tmp,"../uploads/".$file_name); - echo "Success"; - }else{ - print_r($errors); - } - - $redirectUrl = '../index.html'; - echo ''; -} + ?> \ No newline at end of file diff --git a/apis/signature_upload.php b/apis/signature_upload.php new file mode 100644 index 0000000..ecb59a5 --- /dev/null +++ b/apis/signature_upload.php @@ -0,0 +1,35 @@ + 2097152){ + $errors[]='File size must be less than 2 MB'; + $uploadThisFile = false; + } + if($uploadThisFile){ + move_uploaded_file($_FILES["file"]["tmp_name"],$path.$file_name); + if(file_exists($path.$file_name)){ + echo(json_encode(array('status' => 'success', 'result' => $file_name))); + } + }else{ + echo(json_encode(array('status' => 'error', 'result' => "The files should be jpeg/jpg. Problem while uploading"))); + } + +} +else +{ + echo(json_encode(array('status'=>'error','result' => 'No file selected'))); +} +?> \ No newline at end of file diff --git a/certificates/music_Cricklon_3 December, 2020.jpg b/certificates/music_Cricklon_3 December, 2020.jpg new file mode 100644 index 0000000..c60a5b3 Binary files /dev/null and b/certificates/music_Cricklon_3 December, 2020.jpg differ diff --git a/index.html b/index.html index 123e12c..36aec5c 100644 --- a/index.html +++ b/index.html @@ -7,20 +7,21 @@ - - + + - + - + - - - + + +
- +