Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filepicker shadow upload limit. #134

Open
ProgBasil opened this issue May 6, 2024 · 8 comments
Open

Filepicker shadow upload limit. #134

ProgBasil opened this issue May 6, 2024 · 8 comments

Comments

@ProgBasil
Copy link

good day, I'm working on uploading files to my server. I'm using one to one example from:
https://github.com/flet-dev/examples/blob/main/python/controls/file-picker/file-picker-upload-progress.py

When I upload files larger than 536 MB, it only downloads 536 MB to disk. At the same time, on_upload writes that progress is 100%.
I'm still a newbie and most likely I did something wrong, but suddenly I'm not the only one having this problem.

@FeodorFitsner
Copy link
Contributor

What version of Flet is that?

@ProgBasil
Copy link
Author

What version of Flet is that?

0.21.2

@BrentHuang
Copy link

run the demo: 'https://github.com/flet-dev/examples/blob/main/python/controls/file-picker/file-picker-upload-progress.py', output: Exception: Specify secret_key parameter or set FLET_SECRET_KEY environment variable to enable uploads.

In the documentation, it seems that there is no mention of how to pass the 'secret_key' parameter.

@ProgBasil
Copy link
Author

run the demo: 'https://github.com/flet-dev/examples/blob/main/python/controls/file-picker/file-picker-upload-progress.py', output: Exception: Specify secret_key parameter or set FLET_SECRET_KEY environment variable to enable uploads.

In the documentation, it seems that there is no mention of how to pass the 'secret_key' parameter.

You can pass the key from an environment variable or just paste this into your code:

os.environ["FLET_SECRET_KEY"] = os.urandom(12).hex()

@Konstantin-Chemesov
Copy link

Konstantin-Chemesov commented Jun 10, 2024

good day, I'm working on uploading files to my server. I'm using one to one example from: https://github.com/flet-dev/examples/blob/main/python/controls/file-picker/file-picker-upload-progress.py

When I upload files larger than 536 MB, it only downloads 536 MB to disk. At the same time, on_upload writes that progress is 100%. I'm still a newbie and most likely I did something wrong, but suddenly I'm not the only one having this problem.

I have the same problem with size limit (flet version 0.19.0).

@FeodorFitsner
Copy link
Contributor

What error do you get?

@Konstantin-Chemesov
Copy link

Konstantin-Chemesov commented Jun 11, 2024

I'm preparing an app with an opportunity to upload some big files (size more than 2 GB) to S3 storage via presigned url.
File picker gets files, it shows correct size of them, then uploads files to storage without any exceptions or errors, even status bar shows that the files are successfully uploaded to storage. But all the files are cut by size. I mean - even if file's size 2.5 GB, it goes to the storage with only 511.2 MiB size, no matter the file type is. The same thing is with local storage. I cant upload full file to storage.

@mxav1111
Copy link

mxav1111 commented Oct 8, 2024

You can pass the key from an environment variable or just paste this into your code:

os.environ["FLET_SECRET_KEY"] = os.urandom(12).hex()

How would this work with multi threaded app? Gunicorn with multi threaded app has problem it seems when it start it with multiple workers ( --workers ). It gives me invalid request for every subsequent upload. It works fine with first one.
Does it needs to be initialized only once during the lifetime of a entire multi threaded app or this would be a part of function that will be called everytime?
PS: I have set it to fixed value in environment but then also changing this secret key value in a function that is called everytime during upload.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants