Uploading a file to s3 after downloading from a link - amazon-web-services

I have a link in a request which is pointing to some pdf /image content type. My requirement is to upload the content in the link to the s3 server.
Do I have to download it and then uploading the file but I have to many call and limited file storage in the machine Or Is there any other way to achieve this.

You must upload the file to Amazon S3.
It is not possible to tell Amazon S3 to retrieve a file from a URL.

My requirement is to upload the content in the link to the s3 server.
we - you need some compute resource. S3 itself won't do that.
Do I have to download it and then uploading the file
Or Is there any other way to achieve this.
The compute resource (logic) doesn't need to reside on your computer. You may use some AWS Compute resource near the S3, such as Lambda, EC2, ECS, .. You may decide based on the predicted load or other requirements.

Related

Flutter upload files to AWS s3 faster with upload progress

am facing a problem while uploading one or more files i.e images/videos to AWS s3 bucket by using aws_s3_client plugin.
It's taking much time to upload a 10MB file
Not able to track the upload progress percentage
Not having option to upload multiple file at once (if same bucket)
Every time while uploading we have to verify the IM-User access. (since why cant we use single instance at once to verify and keep connection persistent/keep alive until application getting closed)
Hence, am not familiar with AWS services. So, suggest to me a best way to upload a file or multiple files to AWS s3 bucket with faster, with upload progress percentage, multiple file upload at once and persistent connection /Keep Alive verification.
For 1 and 2, use managed uploads, it provides an event to track upload progress and makes uploads faster by using multipart upload. Beware that multipart uploads only work for files having sizes from 5 MB to 5 TB.
For 3, AWS S3 does not allow uploading files having same names or keys in the same bucket. Depending on your requirement, you can turn on versioning in your bucket and that will save different versions of the same file.
For 4, you can generate and use pre-signed URLs. Pre-signed URLs have configurable timeouts that you can adjust depending on how long you want the link to be available for an upload.
Use multi part upload.multi part upload will upload files quickly to S3.
https://docs.aws.amazon.com/AmazonS3/latest/userguide/mpuoverview.html

How to unzip (or rather untar) in-place on Amazon S3?

I have lots of .tar.gz files (millions) stored in a bucket on Amazon S3.
I'd like to untar them and create the corresponding folders on Amazon S3 (in the same bucket or another).
Is it possible to do this without me having to download/process them locally?
It's not possible with only S3. You'll have to have something like EC2, ECS or Lambda, preferably running in the same region as the S3 bucket, to download the .tar files, extract them, and upload every file that was extracted back to S3.
With AWS lambda you can do this! You won't have the extra costs with downloading and uploading to AWS network.
You should follow this blog but then unzip instead of zipping!
https://www.antstack.io/blog/create-zip-using-lambda-with-files-streamed-from-s3/

Amazon s3 upload file to bucket from third party website

Can we use amazon v4 API of amazon: https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-post-example.html but I don't think it's useful for my purpose.
What I want is, there are some files on websites, I want those files to be uploaded in amazon s3 bucket without downloading them first on my local computer, current scenario is like this:
The third-party website provides downloaded link of file -> download file to my computer > upload to amazon s3
Can we eliminate the middle one so it become like this:
The third-party website provides downloaded link of file -> upload to amazon s3
You can't avoid the "download" part unless that "other website" is willing to do upload for you.
But you can eliminate your local network connection from the equation and do download/upload using EC2 instance in the same region as your bucket.
$ wget https://example.com/example.txt
$ aws s3 cp example.txt s3://mybucket
Your EC2 instance should have the role, allowing it to interact with S3.
You can do the same thing with Lambda, but you'll be limited by the size of the filesystem of the lambda runtime.
The third-party website provides downloaded link of file -> upload to amazon s3
If the 3rd party doesn't push the content "itself", you will need an actor/service/logic which downloads and uploads the data.
The "logic" means some compute resources - c2, ecs, lambda, batch.. it's the same download/upload process, just the traffic doesn't need to go through your computer. Every option has its pros and cons (e. g. lambda may be the cheapest for occasional tasks, but it has its limits)
You did not specify what initiates the upload (regular scan? event? on-demand?), that may affect your options too.

Is there any way to upload 50000 image files to Amazon S3 Bucket from a list of URLs

Is there any way to upload 50000 image files to Amazon S3 Bucket. The 50000 image file URLs are saved in a .txt file. Can someone please tell me a better way to do this.
It sounds like your requirement is: For each image URL listed in a text file, copy the images to an Amazon S3 bucket.
There is no in-built capability with Amazon S3 to do this. Instead, you would need to write an app that:
Reads the text file and, for each URL
Downloads the image
Uploads the image to Amazon S3
Doing this on an Amazon EC2 instance would be the fastest, due to low latency between S3 and EC2.
You could also get fancy and do it via Amazon EMR. It would be the fastest due to parallel processing, but would require knowledge of how to use Hadoop.
If you have a local copy of the images, you could order an AWS Snowball and use it to transfer the files to Amazon S3. However, it would probably be faster just to copy the files over the Internet (rough guess... at 1MB per file, total volume is 50GB).

How to unzip 10gb file on AWS S3 browser

suggest the best process using aws cli or any alternatives by downloading to local using s3 browser and upload. (After extracting locally it is 60gb file).
Amazon S3 is purely a storage service. There is no in-built capability to process data (eg to unzip a file).
You would need to download the file, unzip it, and upload the result back to S3. This would best be done via an Amazon EC2 instance in the same region. (AWS Lambda only has 500MB temporary storage space, so this is not an option for a 60GB file.)
You could look at a combination of mime-type and content-disposition meta info on the stored files as .gz
Then even let a web browser deal with decompressing etc., once received compressed.
But, I'm not totally sure what you are after.