Skip to main content
Solved

Download link without the Html page

  • Jan 17, 2017 11:46 AM UTC
  • 8 replies
  • 58 views

boubcher
Contributor
Forum|alt.badge.img+11

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

Best answer by larry

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"
}}

View original
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.

8 replies

itay
Supporter
Forum|alt.badge.img+19
  • Supporter
  • Jan 17, 2017 12:19 PM UTC

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


david_r
Celebrity
  • Jan 17, 2017 2:05 PM UTC

boubcher
Contributor
Forum|alt.badge.img+11
  • Author
  • Contributor
  • Jan 17, 2017 4:28 PM UTC

@itay

Yes that link , hiw could we get it


itay
Supporter
Forum|alt.badge.img+19
  • Supporter
  • Jan 17, 2017 7:58 PM UTC

@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

 

 


Forum|alt.badge.img
  • Jan 17, 2017 8:27 PM UTC

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


Forum|alt.badge.img
  • Best Answer
  • Jan 17, 2017 9:07 PM UTC

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"
}}


itay
Supporter
Forum|alt.badge.img+19
  • Supporter
  • Jan 18, 2017 5:23 AM UTC

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...

 


boubcher
Contributor
Forum|alt.badge.img+11
  • Author
  • Contributor
  • Jan 18, 2017 6:30 AM UTC

@larry thanks thats exactley what we are looking for