<?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: Upload a csv file from SAS to Sharefile dropbox using Proc HTTP in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Upload-a-csv-file-from-SAS-to-Sharefile-dropbox-using-Proc-HTTP/m-p/499805#M72574</link>
    <description>&lt;P&gt;The out= option has to point to a &lt;EM&gt;local&lt;/EM&gt; file where the &lt;EM&gt;returns&lt;/EM&gt; from the HTTP request are to be stored. The target for the post is solely in the url= option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A filename without a specific engine always has to point to a file in the local filesystem. Protocols (http://) do not work, and since the pathname in the filename statement does not satisfy the requirements of an &lt;EM&gt;absolute&lt;/EM&gt; pathname, it is considered &lt;EM&gt;relative&lt;/EM&gt; and appended to the current working directory of the SAS process.&lt;/P&gt;</description>
    <pubDate>Fri, 28 Sep 2018 08:47:14 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2018-09-28T08:47:14Z</dc:date>
    <item>
      <title>Upload a csv file from SAS to Sharefile dropbox using Proc HTTP</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Upload-a-csv-file-from-SAS-to-Sharefile-dropbox-using-Proc-HTTP/m-p/499739#M72567</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to upload a csv file from SAS to&amp;nbsp;Sharefile dropbox using the below code.&lt;/P&gt;&lt;P&gt;When I run the below code, I get 'Physical file does not exist' error. I guess it is not able to translate/read the dropbox URL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Has anyone done something similar before?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename _inbox "https://XXXX.sharefile.com/f/XXXX-f9a8-41b0-8a8f-XXXX";/* Path of the Folder where we wish to upload the document */
filename class "/staff/XXX/userid/test.txt"; /* Path of the Folder where the document is present */


proc http method="post" 
url="https://XXXX.sharefile.com/f/XXXX-f9a8-41b0-8a8f-XXXX" 
webusername="email@xxx.nz" webpassword="XXXX" 
in=class 
out=_inbox 
proxyhost="http://xxxx.corp.xxx.abc.nz" 
proxyport=8080 in=class
ct="application/x-www-form-urlencoded" 
verbose
;
run;

 

Log snippet as below -

URL = https://XXXX.sharefile.com/f/XXXX-f9a8-41b0-8a8f-XXXX
Proxy Host = http://xxxx.corp.xxx.abc.nz
Proxy Port = 8080
METHOD = post
CT = application/x-www-form-urlencoded
In = /staff/xxxx/userid/test.txt
Out = 
/gpfs/sasfs/sasconfig/func/Lev1/DevUnit/https://XXXX.sharefile.com/f/XXXX-f9a8-41b0-8a8f-XXXX
Web Auth User Name = email@xxx.nz

38 run;

ERROR: Physical file does not exist, 
/gpfs/sasfs/sasconfig/func/Lev1/DevUnit/https://XXXX.sharefile.com/f/XXXX-f9a8-41b0-8a8f-XXXX
ERROR: Generic HTTP Client Error
NOTE: PROCEDURE HTTP used (Total process time):
real time 0.28 seconds
cpu time 0.00 seconds

2 The SAS System 10:55 Wednesday, September 26, 2018

NOTE: The SAS System stopped processing this step because of errors.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 28 Sep 2018 00:33:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Upload-a-csv-file-from-SAS-to-Sharefile-dropbox-using-Proc-HTTP/m-p/499739#M72567</guid>
      <dc:creator>bk4</dc:creator>
      <dc:date>2018-09-28T00:33:10Z</dc:date>
    </item>
    <item>
      <title>Re: Upload a csv file from SAS to Sharefile dropbox using Proc HTTP</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Upload-a-csv-file-from-SAS-to-Sharefile-dropbox-using-Proc-HTTP/m-p/499805#M72574</link>
      <description>&lt;P&gt;The out= option has to point to a &lt;EM&gt;local&lt;/EM&gt; file where the &lt;EM&gt;returns&lt;/EM&gt; from the HTTP request are to be stored. The target for the post is solely in the url= option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A filename without a specific engine always has to point to a file in the local filesystem. Protocols (http://) do not work, and since the pathname in the filename statement does not satisfy the requirements of an &lt;EM&gt;absolute&lt;/EM&gt; pathname, it is considered &lt;EM&gt;relative&lt;/EM&gt; and appended to the current working directory of the SAS process.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Sep 2018 08:47:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Upload-a-csv-file-from-SAS-to-Sharefile-dropbox-using-Proc-HTTP/m-p/499805#M72574</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-09-28T08:47:14Z</dc:date>
    </item>
    <item>
      <title>Re: Upload a csv file from SAS to Sharefile dropbox using Proc HTTP</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Upload-a-csv-file-from-SAS-to-Sharefile-dropbox-using-Proc-HTTP/m-p/499807#M72575</link>
      <description>&lt;P&gt;PS consult the documentation: &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.3&amp;amp;docsetId=proc&amp;amp;docsetTarget=n197g47i7j66x9n15xi0gaha8ov6.htm&amp;amp;locale=en" target="_blank"&gt;https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.3&amp;amp;docsetId=proc&amp;amp;docsetTarget=n197g47i7j66x9n15xi0gaha8ov6.htm&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Sep 2018 08:49:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Upload-a-csv-file-from-SAS-to-Sharefile-dropbox-using-Proc-HTTP/m-p/499807#M72575</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-09-28T08:49:04Z</dc:date>
    </item>
    <item>
      <title>Re: Upload a csv file from SAS to Sharefile dropbox using Proc HTTP</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Upload-a-csv-file-from-SAS-to-Sharefile-dropbox-using-Proc-HTTP/m-p/499854#M72576</link>
      <description>&lt;P&gt;Aside from&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;'s advice, I suspect that you will not be able to upload a file with Basic Auth (the webuser/password approach).&amp;nbsp; The ShareFile API, like Box or Google Drive, will require OAuth2 -- which might require that you register an "app" as a developer and then get an access token.&amp;nbsp; This is needed because you'll need to grant the app the appropriate permissions to upload a file to your account.&amp;nbsp; (Things have become lots more complex since the FTP days, right?)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some services allow you to register a webhook that makes this a little simpler -- not sure if ShareFile is one of those.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's definitely possible to do, just some more code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See &lt;A href="https://communities.sas.com/t5/SAS-Procedures/Proc-HTTP-Box-com-REST-API-Trouble-with-uploading-binary-files/td-p/413797" target="_self"&gt;this thread about using the Box API&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Sep 2018 12:26:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Upload-a-csv-file-from-SAS-to-Sharefile-dropbox-using-Proc-HTTP/m-p/499854#M72576</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2018-09-28T12:26:13Z</dc:date>
    </item>
  </channel>
</rss>

