<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Read Multipart/for-data attachment via sas in Developers</title>
    <link>https://communities.sas.com/t5/Developers/Read-Multipart-for-data-attachment-via-sas/m-p/528685#M5855</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is a new information for me and it really helps me.&lt;/P&gt;&lt;P&gt;STEP 1: I tried the html but I am getting "Unsupported Media Type", do I need to configure anything in the storedprocess which I created?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created a stored process via SAS enterprise guide and copy the infile command you created there, but didn't add any prompts, datasouce targets etc.. is this the reason for the error message?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Chithra&lt;/P&gt;</description>
    <pubDate>Mon, 21 Jan 2019 05:28:14 GMT</pubDate>
    <dc:creator>chithra</dc:creator>
    <dc:date>2019-01-21T05:28:14Z</dc:date>
    <item>
      <title>Read Multipart/for-data attachment via sas</title>
      <link>https://communities.sas.com/t5/Developers/Read-Multipart-for-data-attachment-via-sas/m-p/528621#M5853</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I am reposting the same which i posted accidentally in the sas programming forum.&lt;BR /&gt;&lt;BR /&gt;i need to read the attachemnt(file.zip) from the client and create a sas webservice(stored process) in sas.&lt;BR /&gt;&lt;BR /&gt;what the storedprocess needs to do is, read the attachemnt from the request body and copy to one of the folder in the sas server.&lt;BR /&gt;&lt;BR /&gt;Could anyone know about this?&lt;BR /&gt;&lt;BR /&gt;we are using Restful webservice and can be tested in REST API/Client&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Chithra</description>
      <pubDate>Sun, 20 Jan 2019 13:32:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Read-Multipart-for-data-attachment-via-sas/m-p/528621#M5853</guid>
      <dc:creator>chithra</dc:creator>
      <dc:date>2019-01-20T13:32:23Z</dc:date>
    </item>
    <item>
      <title>Re: Read Multipart/for-data attachment via sas</title>
      <link>https://communities.sas.com/t5/Developers/Read-Multipart-for-data-attachment-via-sas/m-p/528622#M5854</link>
      <description>&lt;P&gt;&amp;nbsp;Hi Chithra,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is more a collection of pointers than a full solution, but should lead you on the right path.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Step 1 - Loading your zip file to the SAS server&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;For this you can use a form, or ajax, in your web front end.&amp;nbsp; The form approach is documented here:&amp;nbsp;&amp;nbsp;&lt;A href="https://support.sas.com/documentation/cdl/en/stpug/61271/HTML/default/viewer.htm#a003254547.htm" target="_blank"&gt;https://support.sas.com/documentation/cdl/en/stpug/61271/HTML/default/viewer.htm#a003254547.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Step 2 - Find and Unzip using SAS and save to folder&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;The file you uploaded will be stored in a macro variable named&lt;/P&gt;
&lt;PRE&gt;_WEBIN_FILEREF1&lt;/PRE&gt;
&lt;P&gt;To avoid a subsequent move of the folder, the best approach would be to unzip it directly to the target location.&amp;nbsp; You can&amp;nbsp;do this using a pipe:&lt;/P&gt;
&lt;PRE&gt;infile"unzip %sysfunc(pathname(&amp;amp;_WEBIN_FILEREF1))&amp;nbsp;-d &amp;amp;target_location" pipe;&lt;/PRE&gt;
&lt;P&gt;Or with a pure sas approach -&amp;nbsp;&lt;A href="https://blogs.sas.com/content/sasdummy/2015/05/11/using-filename-zip-to-unzip-and-read-data-files-in-sas/" target="_blank"&gt;https://blogs.sas.com/content/sasdummy/2015/05/11/using-filename-zip-to-unzip-and-read-data-files-in-sas/&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&amp;nbsp; SAS is a great platform for building web applications.&amp;nbsp; For further reference materials, check out the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://www.linkedin.com/pulse/5-tips-sas-app-developers-allan-bowe/" target="_blank"&gt;https://www.linkedin.com/pulse/5-tips-sas-app-developers-allan-bowe/&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://support.sas.com/resources/papers/proceedings17/1091-2017.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings17/1091-2017.pdf&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://support.sas.com/resources/papers/proceedings17/1372-2017.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings17/1372-2017.pdf&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is also a SPWA tag on Sasensei with a number of tips on this topic.&lt;/P&gt;</description>
      <pubDate>Sun, 20 Jan 2019 13:56:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Read-Multipart-for-data-attachment-via-sas/m-p/528622#M5854</guid>
      <dc:creator>AllanBowe</dc:creator>
      <dc:date>2019-01-20T13:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: Read Multipart/for-data attachment via sas</title>
      <link>https://communities.sas.com/t5/Developers/Read-Multipart-for-data-attachment-via-sas/m-p/528685#M5855</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is a new information for me and it really helps me.&lt;/P&gt;&lt;P&gt;STEP 1: I tried the html but I am getting "Unsupported Media Type", do I need to configure anything in the storedprocess which I created?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created a stored process via SAS enterprise guide and copy the infile command you created there, but didn't add any prompts, datasouce targets etc.. is this the reason for the error message?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Chithra&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jan 2019 05:28:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Read-Multipart-for-data-attachment-via-sas/m-p/528685#M5855</guid>
      <dc:creator>chithra</dc:creator>
      <dc:date>2019-01-21T05:28:14Z</dc:date>
    </item>
    <item>
      <title>Re: Read Multipart/for-data attachment via sas</title>
      <link>https://communities.sas.com/t5/Developers/Read-Multipart-for-data-attachment-via-sas/m-p/528700#M5856</link>
      <description>&lt;P&gt;can&amp;nbsp;anyone help me here?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jan 2019 09:05:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Read-Multipart-for-data-attachment-via-sas/m-p/528700#M5856</guid>
      <dc:creator>chithra</dc:creator>
      <dc:date>2019-01-21T09:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: Read Multipart/for-data attachment via sas</title>
      <link>https://communities.sas.com/t5/Developers/Read-Multipart-for-data-attachment-via-sas/m-p/528755#M5857</link>
      <description>&lt;P&gt;Where do you get the "Unsupported Media Type" message? When you hit "OK" in the web form, or in the SAS log of the stored process?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please post your HTML code for the form, and the code of the stored process.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jan 2019 13:38:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Read-Multipart-for-data-attachment-via-sas/m-p/528755#M5857</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-01-21T13:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: Read Multipart/for-data attachment via sas</title>
      <link>https://communities.sas.com/t5/Developers/Read-Multipart-for-data-attachment-via-sas/m-p/528892#M5858</link>
      <description>As Kurt mentions, we need more information on what you are actually doing.  Regarding the STP, be sure to create it WITHOUT headers / footers (stpbegin / end) and set it to have STREAM output to give you control over the response using _WEBOUT.   No need for prompts.</description>
      <pubDate>Mon, 21 Jan 2019 21:16:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Read-Multipart-for-data-attachment-via-sas/m-p/528892#M5858</guid>
      <dc:creator>AllanBowe</dc:creator>
      <dc:date>2019-01-21T21:16:27Z</dc:date>
    </item>
    <item>
      <title>Re: Read Multipart/for-data attachment via sas</title>
      <link>https://communities.sas.com/t5/Developers/Read-Multipart-for-data-attachment-via-sas/m-p/528979#M5859</link>
      <description>&lt;P&gt;i created a sample stored process with out any content, just a %put comment.&lt;/P&gt;&lt;P&gt;The webservice is not triggered at all, if so we need to get any error atleast.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i triggered using REST client/postman&amp;nbsp; and through HTML form.&lt;/P&gt;&lt;P&gt;Both i get unsupported media type.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV class="sgml"&gt;&lt;PRE&gt;&amp;lt;form action="StoredProcessWebApplicationURL" method="post" enctype="multipart&lt;BR /&gt;                         /form-data"&amp;gt;
&amp;lt;input type="hidden" name="_program" value="/Path/StoredProcessName"&amp;gt;
&amp;lt;table border="0" cellpadding="5"&amp;gt;
   &amp;lt;tr&amp;gt;
      &amp;lt;th&amp;gt;Choose a file to upload:&amp;lt;/th&amp;gt;
      &amp;lt;td&amp;gt;&amp;lt;input type="file" name="myfile"&amp;gt;&amp;lt;/td&amp;gt;
   &amp;lt;/tr&amp;gt;
   &amp;lt;tr&amp;gt;
      &amp;lt;td colspan="2" align="center"&amp;gt;&amp;lt;input type="submit" value="OK"&amp;gt;&amp;lt;/td&amp;gt;
   &amp;lt;/tr&amp;gt;
&amp;lt;/table&amp;gt;
&amp;lt;/form&amp;gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 22 Jan 2019 04:39:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Read-Multipart-for-data-attachment-via-sas/m-p/528979#M5859</guid>
      <dc:creator>chithra</dc:creator>
      <dc:date>2019-01-22T04:39:24Z</dc:date>
    </item>
    <item>
      <title>Re: Read Multipart/for-data attachment via sas</title>
      <link>https://communities.sas.com/t5/Developers/Read-Multipart-for-data-attachment-via-sas/m-p/528980#M5860</link>
      <description>&lt;P&gt;I created a stored process in SAS enterprise guide, with no logical code inside,&amp;nbsp;&lt;/P&gt;&lt;P&gt;select execution option in storedprocess server and doesn't add any data source targets etc..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;file--&amp;gt;new--&amp;gt;storedprocess&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;through html form and using rest client/postman i uploaded a file with content type multipart/form-data and hit send button in rest client/api and ok button in html form and i am getting unsupported media type.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does this means sas 9.4 is not suppporting this media type or do i need to change anyting in the stored process or any configuration changes in the sas server?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when i use other content types such as text/xml etc...i am not getting this message atleast i am getting some error.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jan 2019 04:44:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Read-Multipart-for-data-attachment-via-sas/m-p/528980#M5860</guid>
      <dc:creator>chithra</dc:creator>
      <dc:date>2019-01-22T04:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: Read Multipart/for-data attachment via sas</title>
      <link>https://communities.sas.com/t5/Developers/Read-Multipart-for-data-attachment-via-sas/m-p/529285#M5861</link>
      <description>can you post a screenshot?  Are these messages coming from SAS or from Postman?  Loading a file to a stored process should not (by itself) cause any errors.</description>
      <pubDate>Tue, 22 Jan 2019 22:07:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Read-Multipart-for-data-attachment-via-sas/m-p/529285#M5861</guid>
      <dc:creator>AllanBowe</dc:creator>
      <dc:date>2019-01-22T22:07:10Z</dc:date>
    </item>
    <item>
      <title>Re: Read Multipart/for-data attachment via sas</title>
      <link>https://communities.sas.com/t5/Developers/Read-Multipart-for-data-attachment-via-sas/m-p/539052#M5862</link>
      <description>&lt;P&gt;Assuming this is relating to STPs deployed as Web Services to the SASBIWS webapp, and called via the REST interface as documented &lt;A href="http://support.sas.com/documentation/cdl/en/wbsvcdg/64883/HTML/default/viewer.htm#n1wblekhip1yrln1fv2s5b6a2d9f.htm" target="_self"&gt;here&lt;/A&gt;?&lt;/P&gt;</description>
      <pubDate>Wed, 27 Feb 2019 17:02:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Read-Multipart-for-data-attachment-via-sas/m-p/539052#M5862</guid>
      <dc:creator>boemskats</dc:creator>
      <dc:date>2019-02-27T17:02:52Z</dc:date>
    </item>
  </channel>
</rss>

