Skip to main content
Question

FME dataupload does not upload to session dir

  • November 13, 2018
  • 3 replies
  • 13 views

Forum|alt.badge.img

When using a webpage to upload files to FME server, the files are put in a folder with the username of the fme token instead of the session ID retrieved from 

FMEServer.getSession()

The directories based on session are being created, but the files are stored in the user directory (belonging to the token) instead. The file upload does succeed, the following translation fails because it tries to find the files in the session directory. 

Help!

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.

3 replies

Forum|alt.badge.img
  • Author
  • 3 replies
  • November 13, 2018

Let me explain a bit more with some examples:

 

FMEServer.getSession(BuildForm.repository, BuildForm.workspaceName, function(json){
        BuildForm.session = json.serviceResponse.session;
        sessionCode = BuildForm.session;
        BuildForm.path = json.serviceResponse.files.folder[0].path;

results in this response:

{"serviceResponse": {
   "statusInfo": {"status": "success"},
   "session": "35049821",
   "files": {
      "path": "",
      "folder": [{
         "path": "$(FME_DATA_REPOSITORY)/myworkspace/myworkbench.fmw/35049821",
         "name": ""
      }]
   }
}}

but then, my upload request

$('#fileupload').fileupload({
            url : BuildForm.host + '/fmedataupload/' + BuildForm.repository + '/' +  BuildForm.workspaceName + '&opt_namespace=' + sessionCode,  
             headers : {
                'Authorization' : 'fmetoken token=' + BuildForm.token
                 },
            dropzone : $('#dropzone'),
            autoUpload : true,

gives the following response:

{"serviceResponse": {
   "statusInfo": {"status": "success"},
   "session": "admin",
   "files": {
      "path": "",
      "file": [{
         "size": 162240,
         "name": "myfile.zip"
      }],
      "folder": [{"name": ""}]
   }
}}

 where the session parameter is suddenly "admin" (same as the username of the fme token).

I want this parameter to be the session ID (in this example, 35049821).

 

Thanks!


takashi
Celebrity
  • 7842 replies
  • November 13, 2018

The symptom seems to be a known bug once occurred in FME Server 2018.0.0.0. Upgrade the FME Server version if you are using 2018.0.0.0, and use the FMEServer.js library version v3.


Forum|alt.badge.img
  • 288 replies
  • November 15, 2018

Hi @flipvandervalk,

this issue could occur if you are using FME Server 2018.0 with FME Server JS API version 1.1 older lower. If you switch to this FME Server JS API version your script should work and the correct files should be found:

 

 

https://api.fmeserver.com/js/v3/FMEServer.js