Started by Bell GrantNov 3, 2021

Open
How to upload files,create folder into repo using api

0 VIEWES 0 LIKES 0 DISLIKES SHARE
0 LIKES 0 DISLIKES 0 VIEWES SHARE

Hello, I m the usage of GitHub v3 and I need to add a new binary report in the repo. By the usage of KnpLabs Hypertext Preprocessor-GitHub-API, I m exactly doing what says in

1. Get the modern dedicate object

2. Retrieve the tree it points to

3. Retrieve the content of the blob item that the tree has for that unique document route

4. Alternate the content by some means and publish a brand new blob item with that new content, getting a blob SHA again

5. Post a brand new tree item with that record direction pointer changed with your new blob SHA getting a tree SHA back

And soo on. But on the five-factor, I was given an exception.

server error

from this code

$comit=$client->api('git')->commits()->show($userName,$reposit,'master');
$basetree=$client->api('git')->trees()->show($userName,'appwiz',$comit['commit']    ['tree']['sha']);
$newBlob=$client->api('git')->blobs()->create($userName,$reposit,array('content'=> "gitapi",'encoding'=>'base64'));
$client->authenticate($userName,$password,Github\Client::AUTH_HTTP_PASSWORD);
$treeData = array(
        'tree'=>
        array(  array('path'=>'/'
                ,'mode'=>'040000'
                ,'type'=>'tree'
                ,'content'=>'folder')
        )
);

0 Replies

You must be Logged in to reply
Techiio

Techiio is on the journey to build an ocean of technical knowledge, scouring the emerging stars in process and proffering them to the corporate world.

Follow us on:

facebooklinkdeintwitter

Subscribe to get latest updates

You can unsubscribe anytime from getting updates from us
Copyright techiio.com @2020 Kolkata, India
made with by Abhishek & Priyanka Jalan
Copyright techiio.com @2020
made with by Abhishek & Priyanka Jalan