201, 'filename'=>$filename); if( $sign != $csign ){ $data["msg"] = "error sign"; echo json_encode( $data ); return; } if ( $_FILES["file"]["size"] < 409600 && $extension == "pdf"){ if ($_FILES["file"]["error"] > 0){ $data["msg"] = "error file"; echo json_encode( $data ); }else{ try{ $res=move_uploaded_file($_FILES["file"]["tmp_name"], "pdf/".$filename ); $data["code"] = "200"; echo json_encode( $data ); } catch (Exception $e) { echo $e->getMessage(); } } }else{ $data["msg"] = "error size"; echo json_encode( $data ); } ?>