amazon-s3

Using signed requests with AWS S3 and uploading photos?

冷暖自知 提交于 2021-01-28 05:36:37
问题 So I have a react native application that's kind of like slack and I'm trying to do image uploads to s3. I went with getSignedUrl route. So the client pics a photo, fetches a signed url to the bucket then changes the url on the server for that user then a put request to the signed url that was fetched. It mostly works the files get in the right bucket and they are photos. but A) the link makes me download the file instead of displaying it in browser. B) the file isn't an image...its an xml

How does versioning work on Amazon Cloudfront?

孤人 提交于 2021-01-28 05:33:03
问题 I've just set up a static website on Amazon S3. I'm also using the Cloudfront CDN service. According to Amazon, there are 2 methods available for clearing the Cloudfront cache: invalidation and versioning. My question is regarding the latter. Consider the following example: I link to an image file ( image.jpg ) from my index.html file. I then decide to replace the image. I upload a second image with the filename: image_2.jpg and change the link in my index.html file. Will the changes

Unable to upload file in s3 bucket using laravel 5.7- Argument 1 passed to League\Flysystem\AwsS3v3\AwsS3Adapter:

强颜欢笑 提交于 2021-01-28 04:58:55
问题 I am trying to upload the image to the s3 bucket but unable to do so. Getting the following error: Storage::disk('s3')->put($filename, file_get_contents($file)); Argument 1 passed to League\Flysystem\AwsS3v3\AwsS3Adapter::__construct() must be an instance of Aws\S3\S3ClientInterface, instance of Aws\S3\S3Client given, called in /var/www/html/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemManager.php on line 208 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\

AWS S3 CORS Error: Not allowed access

天大地大妈咪最大 提交于 2021-01-28 04:40:52
问题 I'm trying to load images into the Aviary photo editor that I have integrated with my app. The photos are hosted on AWS, while my app is on Heroku. Whenever I load the photos into the app, they show up fine, however when I pass them into the Aviary SDK, which tries to load them onto the Adobe Cloud server, I get a CORS error: Image from origin 'https://s3.amazonaws.com' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on

aws s3 with html2canvas - CORS issue with multiple browsers

岁酱吖の 提交于 2021-01-28 04:25:04
问题 I knew many questions and issues have been already made. But I can't find out clear answer to solve this issue. I use html2canvas to screenshot my page - with image from amazon s3 (cloudfront, too) I tried almost every answer from SO and html2canvas issues. I setup my S3 CORS to allow all / also set my bucket to public. Also I gave all public access to Everyone (Just to test if it works. I will block them after deploy) Here's my CORS for s3 <?xml version="1.0" encoding="UTF-8"?>

How do you perform a credentialed download from s3 using boto3 without saving a file?

眉间皱痕 提交于 2021-01-28 04:15:38
问题 It is simple to perform a credentialed download from s3 to a file using import boto3 s3 = boto3.resource('s3') def save_file_from_s3(bucket_name, key_name, file_name): b = s3.Bucket(bucket_name) b.download_file(key_name, file_name) It is easy to download from s3 to a file-like object using import from StringIO import StringIO import urllib file_like_object = StringIO(urllib.urlopen(url).read()) (see How do I read image data from a URL in Python?) But how do you perform a credentialed download

aws s3 with html2canvas - CORS issue with multiple browsers

牧云@^-^@ 提交于 2021-01-28 04:00:46
问题 I knew many questions and issues have been already made. But I can't find out clear answer to solve this issue. I use html2canvas to screenshot my page - with image from amazon s3 (cloudfront, too) I tried almost every answer from SO and html2canvas issues. I setup my S3 CORS to allow all / also set my bucket to public. Also I gave all public access to Everyone (Just to test if it works. I will block them after deploy) Here's my CORS for s3 <?xml version="1.0" encoding="UTF-8"?>

aws s3 with html2canvas - CORS issue with multiple browsers

不羁岁月 提交于 2021-01-28 02:39:32
问题 I knew many questions and issues have been already made. But I can't find out clear answer to solve this issue. I use html2canvas to screenshot my page - with image from amazon s3 (cloudfront, too) I tried almost every answer from SO and html2canvas issues. I setup my S3 CORS to allow all / also set my bucket to public. Also I gave all public access to Everyone (Just to test if it works. I will block them after deploy) Here's my CORS for s3 <?xml version="1.0" encoding="UTF-8"?>

Premature end of Content-Length delimited message body SparkException while reading from S3 using Pyspark

我的梦境 提交于 2021-01-28 01:42:06
问题 I am using the below code to read S3 csv file from my local machine . from pyspark import SparkConf, SparkContext from pyspark.sql import SparkSession import configparser import os conf = SparkConf() conf.set('spark.jars', '/usr/local/spark/jars/aws-java-sdk-1.7.4.jar,/usr/local/spark/jars/hadoop-aws-2.7.4.jar') #Tried by setting this, but failed conf.set('spark.executor.memory', '8g') conf.set('spark.driver.memory', '8g') spark_session = SparkSession.builder \ .config(conf=conf) \ .appName(

S3 list files newer than

别等时光非礼了梦想. 提交于 2021-01-28 01:41:49
问题 We have an S3 bucket, and a directory with all our access logs. I would like to list files newer than a specific time/date. Any way this can be achieved? The directory has over 100,000 files and it seems inefficient to fetch the entire list and iterate over them all. Thanks in advance! 回答1: I don't see any way to do this via the S3 API. You would need to store the file date as part of the S3 object Key, or store a separate index of S3 objects in a database that you could query by date. 回答2: