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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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