I want to upload an image to a gitlab project using the Gitlab Project Upload API. Since this is not part of the gitlab integration I have to do it with the request node. My whole workflow creates a snapshot of an html email with puppeteer and and then (hopefully) adds it as a comment to a gitlab issue.
Describe the issue/error/question
The API works a described when I upload the file with curl, but I am getting a 400 Bad Request response from Gitlab in my workflow.
I am not familiar with the GitLab API but I will set aside a bit of time to test posting from the HTTP Request later today unless @svzi already has a magic workflow for that
I’ve tested my implementation with binary files and I was able to get it going. Needed to do some tweaks, but the PR is already updated. The PR includes a workflow for testing purposes. That workflow now also contains nodes for binary file handling.
I want to use the Project → Upload a file API (generic upload endpoint for project related files that is used e.g. when you attach an image to an Issue)
Good thing is since @svzi seems to have figured out the hard (binary file upload) part. Adding support for this API should be also easy I think.
@toxsick Sad to say you’re right, at least sad about the part that I’ve only implemented the Repository files API.
I had a look at your API but sadly the file upload works not the same as in the files API. If it had been the same way I would have given it a try, but now I need to refuse. Sorry, maybe someone else can pick it up.
took me a while, but anyone having the same Problem, I was able to solve this with the normal request node.
The root cause was that my binary input (created by the puppeteer node) did not have a “File Name” set and that was what gitlab was rejecting (without really telling me except 400 - Bad Request…)
So I solved this with an additional code node and now it works: