cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

How to hide the external download URL ?

seanccc
17-Peridot

How to hide the external download URL ?

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

3 REPLIES 3
PaiChung
22-Sapphire I
(To:seanccc)

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.

seanccc
17-Peridot
(To:PaiChung)

@PaiChung ,

 

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);

 

PaiChung
22-Sapphire I
(To:seanccc)

Download I would trigger a client side link widget.

Top Tags