From: indresh singh bhadoria Date: Fri, 05 May 2017 18:41:07 +0530 Subject: consume upload doument api --- consume upload doument api --- --- 'a/fetchdoc.php' +++ /dev/null @@ -1,220 +0,0 @@ - - - - - - - - - - - DigiLocker Service Center - - - - - - - - - - - -
- - -
-
- -
-
-
- -
-
-
-
-
-
-
-
- - - - - - - - - &uri=&id="> - * * */ ?> - - - -
NameSizeDate
- "; - echo($api_detail['name']); - } elseif ($api_detail['type'] == "file") { - echo " "; - echo($api_detail['name']); - } - ?> -
- -
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
- - - - - - - - - - - - - -
NameSizeDate
- "; - echo($issued_detail['name']); - ?> - - -
- -
-
-
-
-
-
-
-
-
-
-
-
- -
-
- - - - - - - - --- 'a/loanapproval.php' +++ b/loanapproval.php @@ -2,7 +2,7 @@ include 'header.php'; $code = $_GET['code']; session_start(); -$_SESSION["code"]= $code; +$_SESSION["code"] = $code; $state = $_GET['state']; $url = "https://developers.digitallocker.gov.in/public/oauth2/1/token"; $post = array( @@ -66,26 +66,24 @@ $issuedNew = explode('¿', $resissued); $dataI = json_decode($issuedNew[1], TRUE); -$headers = array( - 'Authorization: Bearer ' . $access_token - //'Authorization: Basic '. base64_encode("$username:$password") -); +$fileContent = file_get_contents('C:/img/digi.png'); +$client_secret = 'DQ3pWgCtB0I3EhSrtTXU'; +$hk = hash_hmac('sha256', $fileContent, $client_secret, true); +$hmac = base64_encode($hk); +$ur = array('Content-Type: application/octet-stream', 'Authorization: Bearer ' . $access_token, 'path : cehck.png', 'hmac : ' . $hmac . ''); $fileContent = file_get_contents('C:/img/digi.png'); $ch = curl_init(); -curl_setopt($ch, CURLOPT_URL,"https://developers.digitallocker.gov.in/public/oauth2/1/file/upload" ); +curl_setopt($ch, CURLOPT_URL, "https://developers.digitallocker.gov.in/public/oauth2/1/file/upload"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_NOSIGNAL, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0); -curl_setopt($ch, CURLOPT_POST,1 ); -curl_setopt($ch, CURLOPT_POSTFIELDS,$fileContent); +curl_setopt($ch, CURLOPT_POST, 1); +curl_setopt($ch, CURLOPT_POSTFIELDS, $fileContent); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_TCP_NODELAY, 1); -curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/octet-stream','Authorization : Bearer . $access_token','path : cehck.png','hmac : CiLhWvbL5EX1+lOTdZzCOgXUzZ+m5fvwxkiEms9Bsvo=')); +curl_setopt($ch, CURLOPT_HTTPHEADER, $ur); $output = curl_exec($ch); -print_r($output); -die(); - ?> @@ -135,190 +133,226 @@ die(); - + + + + + + + + - - - - - + + + + } + + \ No newline at end of file --- 'a/new.php' +++ /dev/null @@ -1,293 +0,0 @@ - - - - - - - - - - - DigiLocker Service Center - - - - - - - - - - - -
-
-
-
-
-

- Important security information: -

-
-
-
    -
  • - Before logging in, please ensure that the URL address on the address bar of your internet browser starts with digilockerservicecenter.gov.in. -
  • -
  • - Never provide your User ID or password to any one on phone or in response to a mail. Report a suspicious mail. -
  • -
  • - Do not enter login or other sensitive information in any pop up window. -
  • -
  • - Verify the site's security certificate by clicking on the padlock icon of your internet browser. For more details, click here. -
  • -
-
-
-
- - - - -
-
- -
- - -
-
- -
-
-
- -
-
-
-
-
-
-
-
- - - - - - - - - &uri=&id="> - * * */ ?> - - - -
NameSizeDate
- "; - echo($api_detail['name']); - } elseif ($api_detail['type'] == "file") { - echo " "; - echo($api_detail['name']); - } - ?> -
- - -
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
- - - - - - - - - - - - - -
NameSizeDate
- "; - echo($issued_detail['name']); - ?> - - -
- -
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
- - - - - - - \ No newline at end of file