I need to upload a file from my local disk to a SAS Content folder. I am using the SAS REST APIs for this.
I am a bit confused reading the API doc on https://developers.sas.com. On the one hand in the "folders" API there is an option to add a "member" to an existing folder. On the other hand, on the "files" API there is an option to create a new file. Not sure what to use and what is the relationship between the two.. Any advice?
Hi @EyalGonen,
You can use the Upload a file end point under the dataTables API. I'm attaching a Postman collection with example usage. Look in step 2. upload data for an example.
Join us for SAS Community Trivia
SAS Bowl XL, SAS Innovate 2024 Recap
Wednesday, May 15, 2024, at 10 a.m. ET | #SASBowl
Hi @joeFurbee
I need to upload text files such SAS programs or binary files like JPG files. Is your solution appropriate for these use cases?
Hi @EyalGonen,
Yes, a text file should be fine. In my example (see below) I use a csv file. In order to provide the file path, I went to the Body section, created a new file Key and provided the path from my client as the Value.
I've not tried with .jpg. Would be interested if that works or not.
Join us for SAS Community Trivia
SAS Bowl XL, SAS Innovate 2024 Recap
Wednesday, May 15, 2024, at 10 a.m. ET | #SASBowl
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!