Skip to main content

you are integrating the download service in our app , could we we get back from the server only the URL download , without the HTML page

Using the FME Server data download produces a url that can be found via the API, is that what you are referring to?


Have you seen the example on the FME Server Playground?


@itay

Yes that link , hiw could we get it


@itay

Yes that link , hiw could we get it

Unfortunately I was wrong and the url cannot be found via the API (unless I missed something) however the FME_SERVER_DEST_DIR paramaeter can help since the last part will contain the name of the zip file produced by the datadownload service and that way you can reconstruct the download url.

 

Hope this helps

 

 


If you workspace notifies a topic on success, you can build the download link from the notification information and store it somewhere.

DATADOWNLOAD_ASYNC_JOB_SUCCESS arrived at 15:20:36
{
    "ws_topic": "DATADOWNLOAD_ASYNC_JOB_SUCCESS",
    "id": "25446",
    "NumFeaturesOutput": "2",
    "OutputLocation": "C:\\ProgramData\\Safe Software\\FME Server\\DefaultResults\\FME_7116131F_1484684423129_4544.zip",
    "StatusMessage": "Translation Successful",
    "subscriber_folder": "C:\\ProgramData\\Safe Software\\FME Server\\DefaultResults\\FME_7116131F_1484684423129_4544_nw",
    "ResultRootDir": "/fmedatadownload/results",
    "LogFileName": "job_25446.log",
    "timeFinished": "Tue-17-Jan-2017 03:20:23 PM",
    "logHome": "C:/ProgramData/Safe Software/FME Server///Logs",
    "timeRequested": "Tue-17-Jan-2017 03:20:23 PM",
    "StatusNumber": "0",
    "requestKeyword": "FILE_DOWNLOAD_SERVICE",
    "jobsuccess_topic": "DATADOWNLOAD_ASYNC_JOB_SUCCESS",
    "jobfailure_topic": "DATADOWNLOAD_ASYNC_JOB_FAILURE",
    "timeStarted": "Tue-17-Jan-2017 03:20:23 PM"
}

The OutputLocation have the zip file name, the ResultRootDir have the url path.

You then concatenate <Your FME Server URL>ResultRootDir/<filename> and this link will get you the file.

Example with above notification:

http://fmeserver/fmedatadownload/results/FME_7116131F_1484684423129_4544.zip


And if you do a call to the fmedatadownload service (http://fmeserver/fmedatadownload/<repository>/<workspace>) with the following options, the returned json contains the download url.

http://fmeserver/fmedatadownload/<repository>/<workspace>?<parameters>&opt;_showresult=false&opt;_servicemode=sync&opt;_responseformat=json

{"serviceResponse": {
   "statusInfo": {
      "mode": "sync",
      "status": "success"
   },
   "jobID": 25449,
   "url": "http://fmeserver/fmedatadownload/results/FME_7116131F_1484685939433_768.zip"
}}


And if you do a call to the fmedatadownload service (http://fmeserver/fmedatadownload/<repository>/<workspace>) with the following options, the returned json contains the download url.

http://fmeserver/fmedatadownload/<repository>/<workspace>?<parameters>&opt;_showresult=false&opt;_servicemode=sync&opt;_responseformat=json

{"serviceResponse": {
   "statusInfo": {
      "mode": "sync",
      "status": "success"
   },
   "jobID": 25449,
   "url": "http://fmeserver/fmedatadownload/results/FME_7116131F_1484685939433_768.zip"
}}

Nice one @larry, missed it somehow on the API info page...

 


@larry thanks thats exactley what we are looking for


Reply