How to save data on user's pc?

Hello Everyone!
In this code I want to split folder on user’s pc who are using my app but when my user runs my anvil app the spitted dataset saves on my computer instead of their . So how we can resolve this issue?

MY ANVIL CODE:

    def file_loader_1_change(self, file, **event_args):
        """This method is called when a new file is loaded into this FileLoader"""
        anvil.server.call("unzip", self.file_loader.file)
        
        n = Notification("YOUR DATASET ARE EXTRACTED!", timeout=None)
        n.show()
          
      ###############################################################################
      def btn_split_click(self, **event_args):
        
        n = Notification("PLEASE WAIT!", timeout=None)
        n.show()
        
        #m= None
        results = anvil.server.call('split',
                                   self.text_box_2.text,![image_2021-02-22_210019|690x253](upload://xgWAFMmqSra7SHHyGwxdkZRJpTo.png) ![image_2021-02-22_210019|690x253](upload://xgWAFMmqSra7SHHyGwxdkZRJpTo.png) 
                                   self.text_box_1.text, 
                                   self.text_box_02.text, 
                                   self.text_box_03.text, 
                                   self.text_box_04.text)
        n.hide()
        n = Notification("YOUR DATASET ARE SPLITTED!", timeout=None)
        n.show()

PYTHON CODE :

It looks like you are using Anvil’s Uplink feature. This allows you to host a Python program, on your computer, that provides Anvil-callable functions. The functions will execute on whichever computer is running the Uplink program.

In this case, that’s your computer. If you want each user, running the Client-side code in their browser, to achieve a similar effect, then you want the resulting code to run in their browser, too.

Browsers have security features, to prevent them from overwriting arbitrary files and folders, so the browser-side code won’t look exactly the same. It may call a Server function, to unpack the data, and return it to the Client’s (browser’s) memory; but the Client will have to use Download to get it from there onto the user’s PC. See Uploading and downloading files

You mean first I convert my splitted folders into zip file and then client download that splitted zip file ?

Yes. A zipfile is not the only way to package the data, but it is probably the easiest for the end-user to work with.

Yes I converted my splitted folder in zip file but I have no idea how user can able to download it. I also check anvil documentation but I am still confuse. Is their any demo app on anvil for downloading?

In fact, there is a whole suite of tutorials, examples, blog entries, etc. at the Learn link above. If I remember correctly, downloading is part of more than one of them.

There are even more examples in this Forum, so use the Search icon, above, to find one that fits your needs.