Closed sarahbethfederman closed 3 years ago
If files are short location key displays https://bucketlocation.tld/somefile.extension
but as I tried to upload a 8.6 Mb video I only get bucketlocation.tld
as value for location
@badunk
Just hit this again with a file at 34.3MB so I guess it starts happening around there. Anything I can do to help this along @badunk? I think it may be a bit beyond my current skill level to solve but I can try and look into it
I think this issue is not related to multer-s3. @sarahbethfederman, @tiagomsmagalhaes are you using Amazon S3? Or maybe DigitalOcean Spaces?
I'm using the enterprise s3 (an internal IT-managed instance with our own endpoint). I wrote a check that changes any relative URLs to a full one that's been fine for the time being (since they're still being uploaded successfully, just the URL is wrong)
@guliash I’m using digital ocean spaces.
It seems that aws-sdk manually adds scheme for a single part upload (when file is small) https://github.com/aws/aws-sdk-js/blob/master/lib/s3/managed_upload.js#L662. But for large files it does nothing https://github.com/aws/aws-sdk-js/blob/master/lib/s3/managed_upload.js#L625.
@tiagomsmagalhaes According to the docs Amazon S3 returns full location in case of multipart upload. But DO Spaces does not return full location in case of multipart upload (see here).
So I think the problem is in different responses from Amazon S3 and DO Spaces.
@sarahbethfederman Can it be that the instance's responses in case of Complete Multipart Upload operation do not contain full location?
Seems like this should be reported upstream to the AWS sdk, if it's not already fixed...
Closing due to inactivity...
I'm having a strange issue when dealing with large (~55MB) file uploads. In the callback after upload, I'm saving the file location to my db like so
req.files.sourceFile[0].location
Usually this resolves to an absolute path, but on really large files this is resolving to a relative path that consists of
<bucket-name>/<file-key>/
. Is there some async issue I'm unaware of? The file itself is being uploaded and exists on s3 like it's supposed to, I'm just not getting the absolute url in the callback.