cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar

Downloading a file from web with header "content-disposition: attachment"

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:

request = New HTTP Request( URL( url), Method( "Get" ), Headers( {"Authorization: Bearer " || token} ));
data = request << send;

I receive the following response header, so I'm confident I am accessing the server: 

GetResponseHeaders = ["content-disposition" => "attachment; filename=text.csv", "content-type" => "text/csv; charset=utf-8", "date" => 06Mar2024:17:08:05, "server" => "uvicorn", "transfer-encoding" => "chunked"];

However data is Empty().  I would like to download the text.csv file, but have been unable to find a way to do so in JSL. 

 

 

1 REPLY 1
jthi
Super User

Re: Downloading a file from web with header "content-disposition: attachment"

Most likely, at least partially, depends on your endpoint. HTTP request get (file download): Operation timed out after 60000 milliseconds or maybe 

<< Download would work

jthi_0-1710241573444.png

 

 

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 << Download(
	"$TEMP/BlueBirds.jmp", "replace", "show progress"
);
If(!Is Empty(file),
	Open(file)
);

 

 

-Jarmo

Recommended Articles