Это видео недоступно.
Сожалеем об этом.

How to Build a File Upload System on AWS with React and a Serverless API | Lambda, S3, API Gateway

Поделиться
HTML-код
  • Опубликовано: 8 сен 2021
  • This video provides a detailed step by step instruction on how to build a file upload system on AWS with React.js in the frontend and a Serverless API in the backend.
    Support the channel plz 😊: www.buymeacoffee.com/felixyu
    video on how to build a login system/web page: • Build an Authenticatio...
    video on serverless APIs in details: • Build a CRUD Serverles...
    video on API authentication with API keys: • API Authentication via...
    video on how to host a website with a custom domain and HTTPS: • Host a Website on AWS ...
    link to get the s3 bucket policy: jinmeister.com/aws/individual...

Комментарии • 81

  • @kmcg101
    @kmcg101 2 года назад +14

    Important detail you left out that was causing a CORS error for me. When you are building your file-processing-service.js file inside your Lambda function, you call util.buildResponse(200). You left out the 2nd parameter, (200, requestBody). This worked for me

  • @ahnafkhan2589
    @ahnafkhan2589 9 месяцев назад

    Thanks for this great tutorial. Exactly what I needed. Really appreciate it.

  • @jackiedo2959
    @jackiedo2959 2 года назад

    Excellent content, keep it up bro

  • @theethicalh3707
    @theethicalh3707 2 года назад +1

    thaaaaaaank you very much bro for those informations you deserve maanyyy likes

    • @FelixYu
      @FelixYu  2 года назад

      Thanks a lot :)

  • @khandoor7228
    @khandoor7228 2 года назад

    Very nice Felix!

  • @chetancc
    @chetancc Год назад +1

    Hi Felix, Thank you for producing informative content. I request you to create a video tutorial of uploading image on AWS with React, so that it gets resized and displays back on the frontend.
    God bless you.

  • @christopheryongo6113
    @christopheryongo6113 Год назад

    Thanks, this is a gem!

    • @FelixYu
      @FelixYu  Год назад

      Glad that u found it helpful!!

  • @shaziyahasan7775
    @shaziyahasan7775 Год назад

    This works like a charm. Thanks, @FelixYu

    • @FelixYu
      @FelixYu  Год назад

      Glad that u found it helpful mate!!

  • @litaoz
    @litaoz 2 года назад +1

    Great video!

    • @FelixYu
      @FelixYu  2 года назад

      Thanks man!!

  • @shaunflagg1117
    @shaunflagg1117 2 года назад +4

    Is there a link to the repo? Does this support multiple file uploads?

  • @vipuls123456
    @vipuls123456 Год назад

    I was able to resolve the cors issue. The code needs to be updated to use nodejs18, or select the runtime for nodejs accordingly. But I need help to understand how we can upload images or pdf files, and also how to upload multiple files in this manner.

  • @nick.swoboda
    @nick.swoboda 2 года назад +1

    Thank you! This is so helpful!

    • @FelixYu
      @FelixYu  2 года назад

      Glad that it helped 👍

  • @bahramebrahimi7235
    @bahramebrahimi7235 Год назад

    hello, new that we created the api, how can i use this API in react, in your other video you were using a lambda service, but can we do this without lambda?

  • @Maximusofff
    @Maximusofff Год назад

    Everything is working well , but the upload action is not happening and I can't able to see the text file in S3 bucket , Need help in this ?

  • @abinemugh
    @abinemugh Год назад

    hey this does not work for audio files. can you recommend changes for that

  • @mingyu2780
    @mingyu2780 2 года назад +4

    not sure if Felix is still active on this channel...anyway, has anyone managed to successfully upload an image to their S3 bucket and be able to download/view it without error? Been trying to troubleshoot this by modifying the lambda function to accept content type "image/jpeg" as well as convert the filecontent to base64 encoding but i keep getting an error message involving the cors header origins....would appreciate any help if anyone has managed to accomplish an image upload. Thanks

    • @FelixYu
      @FelixYu  Год назад

      @mingyu2780 here is another video i have that works for images as well:
      ruclips.net/video/7T5VbMEJStQ/видео.html

  • @risingng4635
    @risingng4635 2 года назад

    Thanks for the video, i followed your steps it works but the issue was that the uploaded file details was correct in cloudwatch log but in my s3 bucket i have ''${s3Subfolder}/${fileName}' just as in the lambda code. please kindly advice.

    • @FelixYu
      @FelixYu  2 года назад

      Make sure u use the back tick symbol not a single quotation mark when u define ${}

  • @boywithapurpose6194
    @boywithapurpose6194 2 месяца назад

    I'm a little lost. I don't know how to access the event body. ( I am new to Javascript and AWS ).

  • @bharathgoud892
    @bharathgoud892 2 года назад +1

    Can you please provide me source code for this? Thanks in advance

  • @xiaoqizhou7740
    @xiaoqizhou7740 Год назад

    can you provide a link to github repo?

  • @vivianfu1017
    @vivianfu1017 2 года назад

    Could you please share the upload file system code?

  • @luisantonioloustaunaubauti7312
    @luisantonioloustaunaubauti7312 2 года назад +3

    Hello. Does this support all file types like images (.jpg or.png)?

    • @user-py1xm2zz6g
      @user-py1xm2zz6g 2 года назад +1

      I am interested in the same question

    • @lute248
      @lute248 2 года назад +1

      Just tested on jpg and it appears in the s3 bucket no issue

    • @lute248
      @lute248 2 года назад +1

      hmm it appears when i download it and tried to view it, the message "it appears that we don't support this file format" and i noticed the value under the metadata value for uploaded image is showing as "application/octet-stream" instead of "image/jpeg" ....is there anything we should change on the lambda function ?

    • @chokeslam1996
      @chokeslam1996 2 года назад

      @@lute248 any luck getting it to work with other files

    • @FelixYu
      @FelixYu  Год назад

      here is another video i have that shows how to upload images:
      ruclips.net/video/7T5VbMEJStQ/видео.html

  • @growkids4499
    @growkids4499 2 года назад +2

    Could you please upload same video for image upload?

    • @FelixYu
      @FelixYu  Год назад

      here is the another video i have that shows how to upload images:
      ruclips.net/video/7T5VbMEJStQ/видео.html

  • @Zayed411
    @Zayed411 3 месяца назад

    can anyone please tell me from where to get the code at 20:30

  • @huongnguyen4467
    @huongnguyen4467 2 месяца назад

    Followed all the steps but still getting an error: "No 'Access-Control-Allow-Origin' header is present on the requested resource." anyone else?

  • @AkashBhalla
    @AkashBhalla 2 года назад

    How can we upload pdf in place of txt file, im trying to upload that the file uploads but when I open it its says --
    Error
    Failed to load PDF document.

    • @FelixYu
      @FelixYu  2 года назад

      is that an error from the lambda function or from the react frontend??

    • @AkashBhalla
      @AkashBhalla 2 года назад

      @@FelixYu I have tried numerous ways, finally going with base64 encoding.But same issue. How can I contact you??

    • @FelixYu
      @FelixYu  2 года назад

      @@AkashBhalla hmm converting it to base64 should work....try to follow this and see if it works
      github.com/CODEZ-UP/pdfToBase64/blob/master/src/App.js

    • @AkashBhalla
      @AkashBhalla 2 года назад

      @@FelixYu thanks

  • @user-ng1dk2wr2j
    @user-ng1dk2wr2j 7 месяцев назад

    how to upload images ???, please help

  • @dontworryaboutit7752
    @dontworryaboutit7752 2 года назад

    I'm getting a 400 error when i post to my api, any ideas why?

    • @Canda-fh4xc
      @Canda-fh4xc 2 года назад

      I had the same issue. As far as I know, status code 404 means either the API path is wrong or there is a typo in the code. What was the problem with your code?

  • @lorisdeluca610
    @lorisdeluca610 2 года назад +1

    When trying to upload I keep on getting "has been blocked by CORS policy No access-control-allow-origin header is present in the requested resource" although I do have them set as "*" in file util.js. What can it be?

    • @FelixYu
      @FelixYu  2 года назад

      make sure u have the correct headers in the response in the lambda (23:26 of the video)

    • @kokwaichan3807
      @kokwaichan3807 2 года назад

      @@FelixYu Hi Felix, i have encountered the same issue with CORS policy Access-Control-Allow-Origin of '*' error. Had redone it and had make sure there is no typo error. But still it's not working. Any idea what had went wrong?

    • @tylersullivan6105
      @tylersullivan6105 2 года назад

      @@FelixYu - Same issue over here.

    • @FelixYu
      @FelixYu  2 года назад

      did u check "Enable API Gateway CORS" in api gateway (14:29 of the video)?

    • @alejandromartindelcampo6468
      @alejandromartindelcampo6468 2 года назад

      Same issue here :(

  • @sergiisechka1993
    @sergiisechka1993 Год назад

    Felix...how come you use class component in 2021? anyway thank you for doing it from scratch!

    • @FelixYu
      @FelixYu  Год назад

      Haha I haven’t done frontend work for a long time. What is the trend now??

    • @sergiisechka1993
      @sergiisechka1993 Год назад

      @@FelixYu hey forgot to delete my comment, I really enjoyed your video. Now trend: Functional components since 2018-2019

    • @Blinknone
      @Blinknone Год назад

      @@FelixYu Git Hooks and functional objects..

  • @AkashBhalla
    @AkashBhalla 2 года назад

    Can you please help me in uploading pdf file

    • @FelixYu
      @FelixYu  Год назад

      yes, here is the video that shows how to upload pdf files:
      ruclips.net/video/7T5VbMEJStQ/видео.html

  • @aliazlanaziz
    @aliazlanaziz 11 месяцев назад

    code link plz?

  • @riazahmad5975
    @riazahmad5975 Год назад

    good effert but where is the code ????

  • @Marky00
    @Marky00 2 года назад

    how do you remove ------WebKitFormBoundary5xOkojIBpXqoCtdp
    Content-Disposition: form-data; name="demo file"; filename="simple.json"
    Content-Type: application/json from the top of the file with out effecting the rest of the file

    • @FelixYu
      @FelixYu  2 года назад

      u will need to parse the string in ur code logic

    • @lute248
      @lute248 2 года назад

      @@FelixYu where’s the link to your repo? I still can’t figure out how to upload the image. The image that gets stored on S3 is still in “application/octet” even when i define the content type in lambda to be image/jpeg I set and I can’t download/open it

    • @FelixYu
      @FelixYu  Год назад

      @@lute248 here is another video i have that shows how to upload images:
      ruclips.net/video/7T5VbMEJStQ/видео.html

  • @linuxhunter007
    @linuxhunter007 2 года назад

    it will me more better if you upload all the code on github so that we can test it and this will avoid typo mistake
    please share the source code

    • @FelixYu
      @FelixYu  2 года назад

      the source code is already uploaded to my github. link is in the description

    • @ianjheferguevarra4345
      @ianjheferguevarra4345 2 года назад +1

      @@FelixYu I can't find the github link source code

    • @user-py1xm2zz6g
      @user-py1xm2zz6g 2 года назад

      @@ianjheferguevarra4345 the same!

    • @Canda-fh4xc
      @Canda-fh4xc 2 года назад

      ​@@ianjheferguevarra4345
      He removed it from his github

  • @AkroshVtu
    @AkroshVtu Год назад

    its my requist to you to please provide source code plz sir

  • @Canda-fh4xc
    @Canda-fh4xc 2 года назад

    This video is missing very important information for the AWS side. Incomplete tutorial.

  • @AkroshVtu
    @AkroshVtu Год назад

    provide source code plzzzz

  • @riazahmad5975
    @riazahmad5975 Год назад

    how the bad behaviour is that we support you through like comment and subscription and you can't share the code...