function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
PJayaPJaya 

How to get the file from Aws S3 without showing secret key and client id in the URL

Harish RamachandruniHarish Ramachandruni
Hi,

use through apex .
Http h = new Http();

     // Instantiate a new HTTP request, specify the method (GET) as well as the endpoint
    HttpRequest req = new HttpRequest();
    req.setEndpoint('https://s3-us-west-2.amazonaws.com/yourfilepath');
    req.setMethod('GET');

    // Send the request, and return a response
    HttpResponse res = h.send(req);

Regards,
Harish.R.
PJayaPJaya
Hi Harish,

using above gets binary, when i try to downlaod the file using content disposition as attachment  the file is downloading but not opening.

I want the file to be downloaded into system without saving to attachment object. If i get the file with Content disposition as inline am not able to download .msg file

Thanks.

 
Harish RamachandruniHarish Ramachandruni
Hi ,

Check before sending through apex . check above code check with .csv file .


Regards,
harish.R