BookmarkSubscribeRSS Feed
cpagrawal
Fluorite | Level 6

Does anyone knows how to attach a file when calling a SAS BI web service ( json in my case ) ? 
I am trying to set up the content-type but it is not working, probably I am using a wrong one. Any help will be appreciated. 
I want to attach a file which will be read by stored process ( calling as an api ) and I will get response which is very short. 

thank you. 

3 REPLIES 3
andreas_lds
Jade | Level 19

afaik the sp-web-app can't handle attachments. You could provide path+name of file, but this is, of course, not what you want.

Quentin
Super User

I haven't called stored processes as a web service, but this old thread talks about building a STP that allows a user to upload a file from a html form.  Perhaps could be adapted for your need.  https://communities.sas.com/t5/SAS-Stored-Processes/Uploading-a-file-through-an-html-form/td-p/20312...

cpagrawal
Fluorite | Level 6

I am not sure still if file type is not supported. 

cpagrawal_0-1648737986797.png

https://documentation.sas.com/doc/en/itechcdc/9.4/wbsvcdg/n0e44v8zffokk6n1b5uu2alusw8p.htm 
if we use multi part when sending the request, it should be able to retrieve the attachment but I am not able to do that. on the other side I am thinking what could be option if I use rest instead of json. 

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
  • 3 replies
  • 892 views
  • 0 likes
  • 3 in conversation