Skip to main content
Solved

Upload Files with REST API


pflegpet
Contributor
Forum|alt.badge.img+8

Hi, 

is it possible to upload a file to the FME Flow shared resource folder through the Flow REST API? I tried to setup a POST request for https://fme.oebb.at/fmerest/v3/resources/connections/<resource>/filesys/<path> but get a 415 Unsupported Media Type Response. I used the following parameters in Postman:

In this example I want to upload the text file “test.txt” to the shared resource folder “Test”. 

Is there a problem with the request, or is this the wrong approach for uploading a file via the REST API? The goal would be to provide a means for external applications to upload files that are then processed by FME Flow. Thank you for your help!

Best answer by lifalin2016

Changing things on FME Server/Flow typically requires authorization, and therefore authentication.

Have you created a suitable token to accompany the request, or a basic digest authentication ?

Otherwise you most likely will be rejected.

Another issue is your <resource> and <path> in your url. These should be replaced by the values FME_SHAREDRESOURCE_DATA and your path respectively in the url, not given as query parameters.

Hope this helps.

View original
Did this help you find an answer to your question?

2 replies

lifalin2016
Contributor
Forum|alt.badge.img+29
  • Contributor
  • Best Answer
  • July 12, 2024

Changing things on FME Server/Flow typically requires authorization, and therefore authentication.

Have you created a suitable token to accompany the request, or a basic digest authentication ?

Otherwise you most likely will be rejected.

Another issue is your <resource> and <path> in your url. These should be replaced by the values FME_SHAREDRESOURCE_DATA and your path respectively in the url, not given as query parameters.

Hope this helps.


pflegpet
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • July 12, 2024

Hi @lifalin2016, accidentally I double posted this question. The orginal post was 


Anyway, what you suggested is correct: I had to change the request URL as you suggested and the body in Postman to “form-data”. 
Nonetheless, thank you for your help!


Reply


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