Skip to content

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

@JosueAChavez

Description

@JosueAChavez

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions