File_loader method

Hi All,

I try to use file_loader button to upload file and pass numbers from input of TextBox. It seems I can upload file but the numbers from textbox doesn’t pass to function. Any insights?

Thanks.
Alex

Hi there and welcome,

Are you able to explain more clearly what you are trying to accomplish. Perhpas share a little clone link or a snippet of code (wrapped in triple backticks) so that your goal is clearer.

Sure. Thanks.

On client:

def file_loader_1_change (self, file, **event_args):

        table  = anvil.server.call ('properties', file, self.length.text)

In above function on client, I want to pass both a file and a number in ‘length’ textbox to a function ‘properties’ on server.

On server:

import anvil.media

@anvil.server.callable

def properties(file, length):

I can pass a file without problem. But the number isn’t passed through. Any idea to figure it out? Thanks.

Perhaps self.length.text doesn’t actually contain what you’re expecting it to contain.

To check that, you can print(self.length.text) immediately before the anvil.server.call.