-
-
Notifications
You must be signed in to change notification settings - Fork 6
Description
Objective:
Introduce a functionality in CBWIRE to specify and enforce a file upload size limit.
Details:
The enhancement involves the ability to set a maximum file size for uploads in CBWIRE. Currently, when a file upload is initiated, CBWIRE requests a signed upload URL and receives the file's size. This process presents an opportunity to implement size checks before the upload proceeds.
Initial Incoming Request:
{
"fingerprint": {
"id": "lqfNNk5kc2O5Gh8s9tAI",
"name": "my-test",
"locale": "en",
"path": "/",
"method": "GET",
"v": "acj"
},
"serverMemo": {
"children": [],
"errors": [],
"htmlHash": "48e6dd7c",
"data": {
"clicked": false,
"myFile": ""
},
"dataMeta": [],
"checksum": "8dd9b6e1456bd3c73651446497a4b72125ece6dd58c724815eb720c1e7f5e2d2"
},
"updates": [
{
"type": "callMethod",
"payload": {
"id": "ksfh",
"method": "startUpload",
"params": [
"myFile",
[
{
"name": "2022-08-21 07.52.50.gif",
"size": 424008,
"type": "image/gif"
}
],
false
]
}
}
]
}
Example Use Case:
An application requires users to upload profile pictures. To optimize storage and bandwidth, a size limit of 200KB is set for these images. When a user attempts to upload a file, CBWIRE checks the file size against this limit before proceeding with the upload.
Expected Functionality:
File Size Verification: On receiving the initial upload request, CBWIRE verifies the file size against a pre-set maximum limit.
Upload Approval/Denial: If the file size is within the allowed range, the upload proceeds. Otherwise, the upload is denied, and the user is notified of the size limitation.
Customizable Limits: Allow administrators or developers to set and modify the file size limits as per application requirements.