Question

Can you Upload FIles to FME Server From a Custom Form?

  • 24 April 2018
  • 3 replies
  • 4 views

Badge +1
  • Participant
  • 126 replies

I have created an FME script that takes a file path as an input and copies it to a folder using the File Copy writer. I have tested it in FME Server and it works.

However, I have a custom web page with an ajax transaction that uses the FMW script in FME Server as the server side program, and this doesn't work. The message says "Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https", although both the HTML page and the FMW script are on the same machine.

Is it possible to upload a file this way, or do I have to use the FME Server interface?


3 replies

Badge +6

Have you setup CORS on FME Server?

Badge +1

Yes, CORS is set up with the methods of HEAD, DELETE, POST, GET, OPTIONS, PUT and the default headers of "authorization, cookie, content-disposition, origin, x-requested-with, access-control-request-headers, content-type, access-control-request-method, cache-control, accept". Is there another method/header that I need to add?

Badge +1

I was able to do it using the sample referenced in the tutorial at https://knowledge.safe.com/articles/583/data-upload-part-3-rest-api.html. Great tutorial.

Reply