Doesn't XTK support query parameters (especially with periods) in file names?

StackOverflow https://stackoverflow.com/questions/12132551

  •  28-06-2021
  •  | 
  •  

Pergunta

I'm using edge XTK by directly including http://get.goXTK.com/xtk_edge.js in my html.

Following code snippet shows how I'm referring to files on my server in XTK.

var skull = new X.mesh();
skull.file = 'http://myserver.com/stls/skull.stl?accessingUserId=dave@ibm.com&accessCode=8999';

As you can see, my file uri's have query parameters, which have periods in them. In such cases, XTK fails with error message:

com&accessCode=8999  file format is not supported.

It looks like XTK forgot to consider that file uri's can have query params with periods. If it is a bug, would you please consider fixing it before release 8. If I'm doing something wrong, can you please point me in the right direction.

Thank you.

Foi útil?

Solução

Haha, you're right.. it doesn't work but you could use the following:

var skull = new X.mesh();
skull.file = 'http://myserver.com/stls/skull.stl?accessingUserId=dave@ibm.com&accessCode=8999&skull.stl';

basically just append another '&.stl' to the query.

we just split the url using the last dot to get the extension.. any proposition for a better solution is welcome.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top