-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
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.

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
Is this something you would want to add? If yes, I can create a pull request.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels