Showing results for 
Search instead for 
Did you mean: 
Showing results for 
Search instead for 
Did you mean: 

The PTC Community email address has changed to Learn more.

Zip file using rest services


Zip file using rest services

I need a custom services to hit external API which provides ZIP File (contains pdfs files) as response and display those pdf files in mashup.



I've never done this, but there is a LoadBinary service in the contentloader functions, you can try that and then save that to the filerepository as zip, and then use the unzip command on the filerepository

after that do a getfilelisting to display the link in a webframe widget.



i tried LoadBinary service in the contentloader functions and saved the response as zip file. But zip file not saved properly. i suspect issue in receiving binary response. 


Can you share sample code to receive zip file as binary response?




Sorry I do not have any code example.

Hi @vijimechanical, I believe there are many possible reasons that could cause a failed GET.

As you may have known, the basic version is as follows:

var params = {
	proxyScheme: undefined /* STRING */,
	headers: undefined /* JSON */,
	ignoreSSLErrors: undefined /* BOOLEAN */,
	useNTLM: undefined /* BOOLEAN */,
	workstation: undefined /* STRING */,
	useProxy: undefined /* BOOLEAN */,
	proxyHost: undefined /* STRING */,
	url: "http://external-site/" /* STRING */,
	timeout: undefined /* NUMBER */,
	proxyPort: undefined /* INTEGER */,
	password: undefined /* STRING */,
	domain: undefined /* STRING */,
	username: undefined /* STRING */

// result: BLOB
var result = Resources["ContentLoaderFunctions"].LoadBinary(params);

I believe you can share the error details found in the script logs.