Skip to main content

Hi, 

I try to upload a file to the FME Flow Shared Resource Folder via the Flow REST API. When I use Postman the request works as expected but I need to send the request in a command prompt with curl. Of course, first I tried to use the curl that can be generated in Postman but it always returns the error “curl: (26) Failed to open/read local data from file/application. 
 

Here are the paramters for the working upload in Postman:

Postman generates the following curl:

curl --location 'https://fmeflow/fmerest/v3/resources/connections/FME_SHAREDRESOURCE_DATA/filesys/Test' --header 'Authorization: fmetoken token=1234' --form 'file=@"/C:/Users/e059231a/Downloads/test_upload.txt"'

 

I already tried to remove the quotes from the filename and to replace the slashes with double backslashes but still get the mentioned error. 

Hi @pflegpet,

 

I tested this on a Windows machine and initially encountered the same error you did. It appears that the Postman cURL code snippet is formatted for Unix-like operating systems.

 

I was able to successfully upload a text file using the formatting below:

Working URL Format

curl --location "https://myfmeflow.com/fmerest/v3/resources/connections/FME_SHAREDRESOURCE_DATA/filesys/Dylan_Testing" --header "Authorization: fmetoken token=12345" --form "file=@C:/Users/dylan/Documents/FME Training/test_upload.txt"


 


@dylan.at.safe,

Thank you! The curl command is now working for me as well. Had to replace the single quotes with double quotes.


Reply