Question

Put zip file on FME Server with REST CALL

  • 23 January 2023
  • 6 replies
  • 5 views

Badge +11

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

Badge +11

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?

Userlevel 4

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.

Badge +11

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?

Userlevel 4

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.

Badge

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

Badge +11

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.'

Reply