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
PDesPDes 

pdf from external url

In the response from 3rd party I am getting url, I want to grab that url and save that pdf in a salesforce object.
If I manually use that url and paste in browser it downloads the file. But when I use pagereference method to show in apex it doesnt show the file.
String url1 = 'some external url' //this I get in httpresponse from 3rd party
Pagereference pg = new Pagereference(url1); 
Blob b = pg.getContentAsPDF();
How can I grab this url and save pdf file in Salesforce.
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Priyanka,

I hope this question is duplicate for the below.

http://​​​​​​​https://developer.salesforce.com/forums?dc=Apex_Code_Development#!/feedtype=SINGLE_QUESTION_DETAIL&dc=Apex_Code_Development&criteria=ALLQUESTIONS&id=9062I000000gFPUQA2 (http://https://developer.salesforce.com/forums?dc=Apex_Code_Development#!/feedtype=SINGLE_QUESTION_DETAIL&dc=Apex_Code_Development&criteria=ALLQUESTIONS&id=9062I000000gFPUQA2)

Please allow experts some time to check the issue and answer it. As it is duplicate. Please close the thread by marking it as best answer.

Thanks,
​​​​​​​