Skip to main content
16-Pearl
August 12, 2024
Solved

Can we make print button widget to download in particular folder.

  • August 12, 2024
  • 1 reply
  • 1670 views

Can we make print button to download in particular folder instead of downloading in downloads folder?

Best answer by TonyZhang

Hi @AP_10343008 ,

If you want to save file to thingworx repository, you need to let users input "repository name", "path" and "file name" in Mashup, and under the hood trigger a custom service that executes functions like below that takes the user input to save file to specified destination.

 

Things["<RepositoryName>"].SaveBinary({
 path: undefined /* STRING */,
 content: undefined /* BLOB */
});

 

If you want users to download to local PC and specify target folder, users need to change the settings in browser as mentioned by Velkumar

1 reply

19-Tanzanite
August 13, 2024

Hi @AP_10343008 

 

You can change download folder option in browser 

Velkumar_0-1723526759274.png

 

I don't think you can control it in widget level.

 

/VR

 

16-Pearl
August 26, 2024

That is common for every operation. 
I want to store file in repository when user clicked thingworx button widget, Apart from this activity, user can decide folder location for other browser related downloads. I want both to be two different locations independently.

 

 

 

TonyZhang16-PearlAnswer
16-Pearl
September 3, 2024

Hi @AP_10343008 ,

If you want to save file to thingworx repository, you need to let users input "repository name", "path" and "file name" in Mashup, and under the hood trigger a custom service that executes functions like below that takes the user input to save file to specified destination.

 

Things["<RepositoryName>"].SaveBinary({
 path: undefined /* STRING */,
 content: undefined /* BLOB */
});

 

If you want users to download to local PC and specify target folder, users need to change the settings in browser as mentioned by Velkumar