Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X
Hi,
My project needs to show a list of attachments and each attachment's URL points to external file server, clicking the URL will show the browser's download page.
The customer requires to hide the URL, for example, the URL should be https://10.20.3.5/files/xxxxx123 instead of https://10.20.3.5/files/testResult.pdf .
Any idea to implement it ?
Regards,
Sean
I don't think there is a direct way to accomplish that. Since the URL will be fired directly from Thingworx.
You may have to build something on the repository side that can receive a REST call from Thingworx and then serves up the file.
BTW I don't think hiding the file name gives any gain, perhaps hiding the path does, because after the file is downloaded, the person will know the final piece to that url.
You might also be able to do it with the Thingworx agent installed so you can do an initial file transfer from Agent to Thingworx and then have them download from Thingworx, this would also obscure the path of origin.
Now if you feel it just doens't look good to see the full path, you can always list descriptions paired with the url and execute on the url. but that doesn't seem to be what you are asking.
I would send REST call from Thingworx to the repository side. But how to make the browser start to download ?
I know the response should has the header below , but Thingworx's return type doesn't include HttpResponse, how to implement it in Thingworx ?
response.setHeader("Content-disposition", "attachment; filename=" + fileName);
Download I would trigger a client side link widget.