DEV Community

Priyadarsini
Priyadarsini

Posted on

How can I upload pdf files in Egnyte using Rest API and Java

Having the PDF files in local drive(D:). Need to upload those PDF files in Egnyte with the help of Rest API and Java

Top comments (3)

Collapse
 
awwsmm profile image
Andrew (he/him)

This is a very specific question. Could I ask why you need to do this? What progress toward a solution do you have so far?

Collapse
 
priyamuthuvel profile image
Priyadarsini • Edited

public static void main(String[] args) {
File testupload=new File("C:\Users\MSTSYS0\renamedfile\a.png");
RestAssured.baseURI="apidemo.egnyte.com/pubapi/v1/fs/Sh...";
Response response=given()
.multiPart(testupload)
.when().
post("/Uploads");
System.out.println(response.getStatusCode());
System.out.println(response.asString());
}

Collapse
 
niranjandamle profile image
Niranjan Damle

Did you get this to work? if yes, can you please share some sample code?