Hi ,
Any one please help me to achieve this. I am uploading files using platform App user (through JWT Oauth2), I am able to upload and download the file. But here I have scenario like, if the file is uploaded as 'TestFile.jpg' then I want to download it as 'sample.jpg'. I have tried to add content-disposition header for my Download method, but file is getting downloded with actual file name Could you please help me for this.
Below is the code that I am trying,
HttpRequest req = NEW HTTPRequest ();
req.setMethod ('GET');
req.setEndpoint ('https://api.box.com/2.0/files/***number removed for privacy***855/content');
req.setHeader ('Authorization', 'Bearer '+accessToken);
req.setHeader ('content-disposition', 'attachment; filename="test.png"');
HTTP http = NEW HTTP ();
HTTPResponse res = http.send (req);
String downloadURL = '';
downloadURL = res.getHeader('Location');
Thanks,
Srikanth