0

Im trying to upload a pdf file using the octokit nuget package in c#. But whenever i try to upload something i have to convert it to a string or i will get an error. If i convert the pdf to a string im able to upload it to my repo, but then its not a valid pdf file.

Im using this code: gitHubClient.Repository.Content.CreateFile(owner, repoName, filepath, new CreateFileRequest($".", File.ReadAllBytes(@"C:/Temp/CUSTOM.pdf").ToString(), branch));

Could someone please help me, i tried researching but i either find old articles or once which only upload a text file.

Janik313
  • 19
  • 3
  • What do you mean by does not work? What's the error you are getting? – Chetan Aug 18 '21 at 18:35
  • Does this answer your question? [Updating a file in GitHub repository using Octokit](https://stackoverflow.com/questions/41316067/updating-a-file-in-github-repository-using-octokit) – Chetan Aug 18 '21 at 18:38

0 Answers0