Skip to main content
Question

Put zip file on FME Server with REST CALL


jelle
Contributor
Forum|alt.badge.img+16
  • Contributor

I want to put a ZIP file on FME_SHAREDRESOURCE_DATA using the FME Server API:

 

image 

The file gets copied, but the ZIP file becomes smaller and corrupted. Even a ZIP file of 1KB. Any ideas why this happens? I've tried on two different FME Servers, since I thought it would be the server configuration.

 

If I do the same with an XML file or a TXT file, regardless the size, it works well.

6 replies

jelle
Contributor
Forum|alt.badge.img+16
  • Author
  • Contributor
  • January 24, 2023

When using an HTTP Caller, it also works. However, I need to explain a .Net Developer how to put together the API Call. He has the same problem as in the API interface of FME Server (see screenshot above).

 

So, this is fine:image 

What makes this different from a call in the browser?


david_r
Celebrity
  • January 24, 2023
jelle wrote:

When using an HTTP Caller, it also works. However, I need to explain a .Net Developer how to put together the API Call. He has the same problem as in the API interface of FME Server (see screenshot above).

 

So, this is fine:image 

What makes this different from a call in the browser?

My first guess would be that the zip file gets corrupted because it's sent as a text file rather than as a binary file. The developer needs to check the content type of the file transfer.


jelle
Contributor
Forum|alt.badge.img+16
  • Author
  • Contributor
  • January 24, 2023

Thank you David, I indeed saw that this is not part of his procedure.

 

However, the first screenshot of the API interface of FME Server states Content-Type: application/octet-stream

Why wouldn't this be working?


david_r
Celebrity
  • January 24, 2023
jelle wrote:

Thank you David, I indeed saw that this is not part of his procedure.

 

However, the first screenshot of the API interface of FME Server states Content-Type: application/octet-stream

Why wouldn't this be working?

I couldn't say, but I guess it's theoretically possible that the header be right, but the actual file contents be wrong.

I suspect that the API documentation forms are auto-generated using something like Swagger, so I'm not sure how much testing it gets at Safe.


Forum|alt.badge.img
  • February 7, 2023

I transferred the zip file to fme server by using the following configurations:image


jelle
Contributor
Forum|alt.badge.img+16
  • Author
  • Contributor
  • February 7, 2023
sal wrote:

I transferred the zip file to fme server by using the following configurations:image

Yes, within an FME process it worked well, but the API call comes from another application. The problem was solved. The developper answered me the following: 'I have passed the body in a different way (first pack everything in memory and then pass everything at once instead of streaming) and that seems to work. Of course, that approach has the disadvantage that those packets could theoretically be arbitrarily large and this could completely use up the application's memory.'


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings