BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
MaT721
Calcite | Level 5

Hello everyone,

 

In my personal folder, which you can see in the image below, I have images in PNG format that I would like to download automatically with code.

 

image.png

 

If I right click on one of the images and choose download I can see the link that is generated.

 

https://host:port/SASStudioV/sasexec/sessions/ce621d14-131743d0-908e-b223a6250a68/workspace/download...

The part between sessions and workspace changes with each new connection.

 

How to do with proc http ?

 

Thanks.

 

1 ACCEPTED SOLUTION

Accepted Solutions
miaeyg
Fluorite | Level 6

Hi @MaT721 ,

 

I am not sure if what I am suggesting is the best way but I think it will work...you can use the SAS Viya REST API to create a compute server session and then submit SAS code which assigns a fileref that points to your image that you want to download and then download it using this API: https://developer.sas.com/apis/rest/v3.5/Compute/#download-a-file

 

Another option which I am not sure will work is to somehow use the Files API but I am not sure if it can be used to access files on disk or just files in the SAS Content Server.

 

HTH,

Eyal

 

View solution in original post

1 REPLY 1
miaeyg
Fluorite | Level 6

Hi @MaT721 ,

 

I am not sure if what I am suggesting is the best way but I think it will work...you can use the SAS Viya REST API to create a compute server session and then submit SAS code which assigns a fileref that points to your image that you want to download and then download it using this API: https://developer.sas.com/apis/rest/v3.5/Compute/#download-a-file

 

Another option which I am not sure will work is to somehow use the Files API but I am not sure if it can be used to access files on disk or just files in the SAS Content Server.

 

HTH,

Eyal

 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1127 views
  • 1 like
  • 2 in conversation