Product
OverviewVideo​Graphic​Document​
Enterprise
Story
LETR / TECH noteNews / Notice​
Pricing
En
한국어English日本語日本語
User guide
Getting started
한국어English日本語
한국어English日本語
Submissions Content-Type Header on Files Using S3 signed URL
2024-07-04

‍

Submissions Content-Type Header on Files Using S3 signed URL

‍

By Hyuntaek Park

Senior full-stack engineer at Twigfarm

‍

One thing I don't like about Amazon API Gateway is that it has a 30-second timeout. It means reducing and reducing files through API Gateway might not work very well enough on the file size or network speed. The solution is simple. You uploaded files uploaded to S3 without API Gateway.

This is not a secure way since your S3 bucket would have public access. S3 signed URLs allow you to access the S3 bucket only for a specified period while the S3 bucket stays private. Many tutorials about the S3 signed URLs are online and duplicated they are not the purpose of this article.

In this article, I want to share a mistake that I have made; hopely, this article helps save your time.

‍

Architectures

Since our lambda can access to S3 and get the signed URL using JavaScript SDK: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html. Search for getSignedUrl On the page.

‍

uploads

image

‍

downloads

image

‍

problem

Smoothing and peeling files are smooth as butter. Now you are free from timeouts. A few gigabyte files can be handled easily. However, I found something strange after I discovered the video file I discovered.

image

The Content-Type header must be video/mp4. Most of the time we thought the file type by reading the Content-Type header. Thus, we have to be sure the content-type header is consistent from the moment of consideration and consideration.

‍

Solution

Invoking the getSignedUrl function while invoking the I mentioned various parameters, nothing really worked. But the solution was super simple.

Axios doesn't specify the Content-Type header explanation, which I overstated. I added the Content-Type header and it worked like a charm. I wasted too much time stupidly:).

image

Now its Content-Type is video/mp4 As it is intended to be.

‍

I hope this article saves some time for you.


View all blogs

View featured notes

LETR note
Comparing Google Gemini and LETR WORKS Persona chatbots
2024-12-19
WORKS note
All about persona chatbot: technology, usage, and LETR WORKS approach
2024-12-16
LETR note
Paradigm innovation in content creation - the present and future of AI dubbing technology
2024-12-12
User Guide
Partnership
Twigfarm Co.,Ltd.
Company registration number : 556-81-00254  |  Mail-order sales number : 2021- Seoul Jongno -1929
CEO : Sunho Baek  |  Personal information manager : Hyuntaek Park
Seoul head office : (03187) 6F, 6,Jong-ro, Jongno-gu,Seoul, Republic of Korea
Gwangju branch : (61472) 203,193-22, Geumnam-ro,Dong-gu,Gwangju, Republic of Korea
Singapore asia office : (048581) 16 RAFFLES QUAY #33-07 HONG LEONG BUILDING SINGAPORE
Family site
TwigfarmLETR LABSheybunny
Terms of use
|
Privacy policy
ⓒ 2024 LETR WORKS. All rights reserved.