Skip to main content
Solved

Upload Files with REST API

  • July 9, 2024
  • 2 replies
  • 313 views

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.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

lifalin2016
Supporter
Forum|alt.badge.img+38
  • Supporter
  • 592 replies
  • 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
  • 62 replies
  • 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!