I would like to a upload binary file to an existing release on GitHub, using the API published here.
developer.github.com/v3/repos/releases
Is it possible to upload a binary with a gh() POST?
In the meantime, I have tried with the R curl package. Assuming RELEASEID is the release ID to upload to, I might use:
library(curl)
h=new_handle()
handle_setheaders(h, Authorization="token XXXXX",
"Content-Type" = "application/x-dosexec",
"User-Agent" = "curl")
handle_setform(h, app=form_file("app.exe", "application/x-dosexec"))
url="https://uploads.github.com/repos/:OWNER/:REPO/releases/:RELEASEID/assets?name=app.exe"
curl_fetch_memory(url, handle=h)
The upload appears to succeed, but, when I download the file app.exe, it is corrupted.
I do not experience problems with other MIME types, e.g. PDFs.
Also, using curl.exe from the shell, app.exe does not break.
I would like to a upload binary file to an existing release on GitHub, using the API published here.
developer.github.com/v3/repos/releases
Is it possible to upload a binary with a
gh()POST?In the meantime, I have tried with the R
curlpackage. AssumingRELEASEIDis the release ID to upload to, I might use:The upload appears to succeed, but, when I download the file
app.exe, it is corrupted.I do not experience problems with other MIME types, e.g. PDFs.
Also, using
curl.exefrom the shell,app.exedoes not break.