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

Uploading a local blob using FilePicker.upload() on Web #180

Open
JosueAChavez opened this issue Nov 14, 2024 · 0 comments
Open

Uploading a local blob using FilePicker.upload() on Web #180

JosueAChavez opened this issue Nov 14, 2024 · 0 comments

Comments

@JosueAChavez
Copy link

The AudioRecorder's stop_recording() method returns a Blob URL when it stops recording (example: blob:http://127.0.0.1:56495/c914bef7-8043-4b2f-9794-b2760b9bf20c).

What is the correct way to read that into FilePicker's upload method so it can be stored in the system that's running the flet application? When creating a FilePickerUploadFile for the upload, I tried using it using Page's [get_upload_url](https://flet.dev/docs/controls/page/#get_upload_urlfile_name-expires) for the upload_url field , but I'm not sure what filename should be.

This is what I've been doing. Nothing happens and no errors are thrown

        uf = []
        filename = recorder.stop_recording()
        url = page.get_upload_url(filename, 600)
        
        uf.append(
            ft.FilePickerUploadFile(
                filename,
                upload_url=url,
            )
        )
        file_picker.upload(uf)

Any help would be greatly appreciated! Thanks!

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

1 participant