next-s3-upload icon indicating copy to clipboard operation
next-s3-upload copied to clipboard

Chrome Large File Issue

Open jhochgrevetsd opened this issue 2 years ago • 6 comments

Hey thanks for such a great package!! I am having some issues when uploading larger file (over 1Gish) when using Chrome (all other browsers seem to work) here is the error: net::ERR_CONNECTION_RESET

Is there anything I can do to avoid this? It seems to happen more times than not, but occasionally a file works without the error.

jhochgrevetsd avatar Aug 09 '22 16:08 jhochgrevetsd

Odd! I know we tested large files, but that was a while ago and there have been a few changes to the aws-sdk version since then.

Does it work in chrome w/ an incognito window?

I'll give this a test in with a large file in chrome and let you know how it goes.

ryanto avatar Aug 10 '22 15:08 ryanto

@ryanto Great question. I did not check in Incognito (rookie mistake) I will test this also.

jhochgrevetsd avatar Aug 10 '22 16:08 jhochgrevetsd

@ryanto Tested in chrome with the same error. I was specifically using a 1.6GB .ZIP file

Here is our implementation. Nothing fancy. We are not uploading on change but rather on submit:

        let { url } = await uploadToS3(data.plan, {
          endpoint: {
            request: {
              body: {
                projectEmail: data.email
              }
            }
          }
        })

Then our API file:

import { APIRoute } from "next-s3-upload";

export default APIRoute.configure({
  async key(req, filename) {
    let projectEmail = req.body.projectEmail;

    return `plans/${projectEmail}/${filename}`;
  }
});

jhochgrevetsd avatar Aug 10 '22 16:08 jhochgrevetsd

Ok cool! Thanks for the code samples, that should totally work so I think there's a bug somewhere :)

I just tested this with a 1.5gb file and a 14gb file in chrome. They both worked.

However, I did notice that we only give the frontend one hour to finish the upload (after an hour we revoke access). Is it possible your uploads are taking over an hour?

Also, when the upload fails you'll probably have a request in your network tab that triggered the failure (it'll be red and probably the last request or so). Could you share the response from AWS for that request, sometimes they give helpful error messages.

ryanto avatar Aug 18 '22 03:08 ryanto

@ryanto Sorry it took me a while to get back! LOTS of projects right now! It's odd...I actually did recieve an error in the network tab; however it is not terribly helpful. I have attached a screenshot of it, and the console error: Screen Shot 2022-08-31 at 10 07 57 AM

Screen Shot 2022-08-31 at 9 59 13 AM

jhochgrevetsd avatar Aug 31 '22 14:08 jhochgrevetsd

Thanks! Don't worry about taking a while to respond :) it's totally fine and I really appreciate the feedback/help debugging this.

About how long after the upload started did you get that error?

Also mind screenshoting the "Headers" tab as well, sometimes there's some good info in there.

ryanto avatar Aug 31 '22 16:08 ryanto

Hey @jhochgrevetsd I'm doing some issue closing on this repo, so I'm going to close this one.

Let me know if you're still running into this or want any help debugging.

ryanto avatar Nov 28 '22 16:11 ryanto