Skip to main content

I am trying to submit a csv to a workspace in the cloud using javascript API

~below is the call to submit the job to the workspace.

FMEServer.submitSyncJob(repository,workspace,params,showResults)

The data gets uploaded but the workspace fails with this message:

CSV reader: Failed to open file
'C:\\fakepath\\1801116-012618RF(TGS_Export_v2).csv' for reading. Please
ensure that the file exists and you have sufficient privileges to read
it.

Is this a permissions issue, the csv is uploaded to the server so I am wondering why the file is not available for processing also the log file appears to show that the workspace continues but does not produce a result.

Hi @garydlester,

You probably need to change the path in your workspace to the location the of the file you uploaded. The best practice for file paths on FME Server is to use the FME Server Parameters. These parameters are set at runtime on FME Server. Check the documentation for more details. For example, for the Resources > Data location you would use the parameter $FME_SHAREDRESOURCE_DATA. You can also find out the correct path to use in your workspace by selecting the file you want to reference and showing it's properties in the FME Sevre web user interface: file-properties.png

If you want to test your workspace on your machine you can set the path of your local file in the FME Server Parameter. This way the local path will always be used when you run it on your machine, but once you upload it to FME Server the path will be replaced.

I hope this helps!


Hi @garydlester, I suspect that you have set the file path in your local machine to the source dataset parameter.

See the example code of "Upload File In Session". In the demo, the setVars function (callback for the FMEServer.getSession function) describes how you can get the directory path where files uploaded in the session will be saved.


Reply