<?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 Downloading a file from web with header &amp;quot;content-disposition: attachment&amp;quot; in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Downloading-a-file-from-web-with-header-quot-content-disposition/m-p/730359#M91314</link>
    <description>&lt;P&gt;I would like to download a csv file from a webpage, however when I send the HTTP request the return is Empty(). My code is as follows:&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;request = New HTTP Request( URL( url), Method( "Get" ), Headers( {"Authorization: Bearer " || token} ));
data = request &amp;lt;&amp;lt; send;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I receive the following response header, so I'm confident I am accessing the server:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;GetResponseHeaders = ["content-disposition" =&amp;gt; "attachment; filename=text.csv", "content-type" =&amp;gt; "text/csv; charset=utf-8", "date" =&amp;gt; 06Mar2024:17:08:05, "server" =&amp;gt; "uvicorn", "transfer-encoding" =&amp;gt; "chunked"];&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;However data is Empty().&amp;nbsp;&amp;nbsp;I would like to download the text.csv file, but have been unable to find a way to do so in JSL.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 06 Mar 2024 17:26:25 GMT</pubDate>
    <dc:creator>BackwardEffect6</dc:creator>
    <dc:date>2024-03-06T17:26:25Z</dc:date>
    <item>
      <title>Downloading a file from web with header "content-disposition: attachment"</title>
      <link>https://community.jmp.com/t5/Discussions/Downloading-a-file-from-web-with-header-quot-content-disposition/m-p/730359#M91314</link>
      <description>&lt;P&gt;I would like to download a csv file from a webpage, however when I send the HTTP request the return is Empty(). My code is as follows:&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;request = New HTTP Request( URL( url), Method( "Get" ), Headers( {"Authorization: Bearer " || token} ));
data = request &amp;lt;&amp;lt; send;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I receive the following response header, so I'm confident I am accessing the server:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;GetResponseHeaders = ["content-disposition" =&amp;gt; "attachment; filename=text.csv", "content-type" =&amp;gt; "text/csv; charset=utf-8", "date" =&amp;gt; 06Mar2024:17:08:05, "server" =&amp;gt; "uvicorn", "transfer-encoding" =&amp;gt; "chunked"];&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;However data is Empty().&amp;nbsp;&amp;nbsp;I would like to download the text.csv file, but have been unable to find a way to do so in JSL.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2024 17:26:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Downloading-a-file-from-web-with-header-quot-content-disposition/m-p/730359#M91314</guid>
      <dc:creator>BackwardEffect6</dc:creator>
      <dc:date>2024-03-06T17:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: Downloading a file from web with header "content-disposition: attachment"</title>
      <link>https://community.jmp.com/t5/Discussions/Downloading-a-file-from-web-with-header-quot-content-disposition/m-p/733287#M91465</link>
      <description>&lt;P&gt;Most likely, at least partially, depends on your endpoint.&amp;nbsp;&lt;LI-MESSAGE title="HTTP request get (file download): Operation timed out after 60000 milliseconds" uid="224384" url="https://community.jmp.com/t5/Discussions/HTTP-request-get-file-download-Operation-timed-out-after-60000/m-p/224384#U224384" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;or maybe&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;lt;&amp;lt; Download would work&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1710241573444.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/62112i9C71A505624F8305/image-size/large?v=v2&amp;amp;px=999" role="button" title="jthi_0-1710241573444.png" alt="jthi_0-1710241573444.png" /&gt;&lt;/span&gt;&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-jsl"&gt;Names Default To Here(1);

request = New HTTP Request(
	URL(
		"https://community.jmp.com/kvoqx44227/attachments/kvoqx44227/sample-data/49/1/BlueBirds.jmp"
	),
	Method("Get")
);
file = request &amp;lt;&amp;lt; Download(
	"$TEMP/BlueBirds.jmp", "replace", "show progress"
);
If(!Is Empty(file),
	Open(file)
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 11:14:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Downloading-a-file-from-web-with-header-quot-content-disposition/m-p/733287#M91465</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-03-12T11:14:05Z</dc:date>
    </item>
  </channel>
</rss>

