Open 1490113799 opened 9 months ago
The method works great: https://github.com/gitlab4j/gitlab4j-api/blob/47e9e6709010be6bbe0c01c8c1e4507eacd7828a/src/main/java/org/gitlab4j/api/ProjectApi.java#L2718
Here a small jbang script to test it:
```java
///usr/bin/env jbang "$0" "$@" ; exit $?
//DEPS info.picocli:picocli:4.6.3
//DEPS org.gitlab4j:gitlab4j-api:5.4.0
//JAVA 17
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Properties;
import java.util.concurrent.Callable;
import org.gitlab4j.api.GitLabApi;
import org.gitlab4j.api.models.FileUpload;
import picocli.CommandLine;
import picocli.CommandLine.Command;
import picocli.CommandLine.Option;
@Command(name = "FileUplaodScript", mixinStandardHelpOptions = true, version = "FileUplaodScript 0.1", description = "Tests with fileupaload in GitLab")
class FileUplaodScript implements Callable
Can be executed with:
jbang FileUplaodScript.java --file Screenshot.png --filename test.png --project 322
And it returns:
{
"alt" : "test",
"url" : "/uploads/eb387237f3204bb2d0782692fc5ddda9/test.png",
"markdown" : "![test](/uploads/eb387237f3204bb2d0782692fc5ddda9/test.png)"
}
So I would say it works as expected
method projectApi.uploadFile() can not upload files,What method can I use to upload files