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

BASUG is hosting free webinars Next up: Mark Keintz presenting History Carried Forward, Future Carried Back: Mixing Time Series of Differing Frequencies on May 8. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
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. 

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