Skip to content

File Upload with Max File Size limit #11

@gkorsten

Description

@gkorsten

Uploading a file and returning an error if it goes over a given size

I wanted to allow file uploads of only 1mb, but the SDKs ReadSignals doesn't support it.

I went to check the file upload example on how it's doen there, but uploading a large file there, results in a retry loop, and it doesn't gracefully handle the situation.
Image

I wrote some code to do it outside of the SDK, and it errors gracefully if it reaches above the given size. I think it can be useful to have this function in the SDK, so I have done some work to see if it's possible, my thinking was the following API:

datastar.ReadSignalsWithLimit(r *http.Request,signals any,maxUploadSize int64) error

gkorsten@158ef5e

Is this something you would want to add? If yes, I can create a pull request.

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