Hi!
We use simple forms in Gatsby with lambda functions on Netlify to add a new record in DatoCMS.
In one form we need to send and write video, so we use NodeJS client and base64 format for file .
Is any limit for a size of files written by this way in DatoCMS?
Thank you for answer!
100 MB is good enough for our short videos.
But we have got the error āYour lambda function took longer than 10 seconds to finish.ā
May be using Base64 for transport file to lambda function and writing files from this format is not a good way for video files.
Could you give the cue for better way to send video file by the form?
you can do step 2 from the browser and step 1 and 3 from your lambda so that you donāt have to share the write token to the browser, what do you think?
Inspect what the browser is doing in our media area, itās the exact same idea
where shortVideo = acceptedFiles[0] from <Dropzone /> from āreact-dropzoneā
We are not sure about full URL, but we couldnāt see it from example PUT https://dato-images.s3.eu-west-1.amazonaws.com/205/1565776891-image.png?x-amz-acl=public-read&... HTTP/1.1<YOUR_FILE_BINARY_CONTENT>
As I mentioned here: Load video by lambda function and NodeJS client you should do step 1 in the lambda and get the URL to the browser where you can do the upload and then go back to the lambda to create the upload object in Dato. Is that any helpful?
But, we have got error with status code 406. Please, tell us, about requered headers. Maybe we missed some required attributes?
We took required attributes from documentation ( Step 1: Request an upload permission)
Depending on the size of the data you are uploading, Amazon S3 offers the following options:
Upload objects in a single operationāWith a single PUT operation, you can upload objects up to 5 GB in size.For more information, see Uploading Objects in a Single Operation.