amazon-s3

How to delete a file with an empty name from S3

大兔子大兔子 提交于 2020-08-27 09:00:08
问题 Somehow, using the AWS Java API, we managed to upload a file to S3 without a name. The file is shown if we run s3cmd ls s3://myBucket/MyFolder , but is not shown in the S3 GUI. Running s3cmd del s3://myBucket/MyFolder/ give the following error: ERROR: Parameter problem: Expecting S3 URI with a filename or --recursive: s3://myBucket/MyFolder/ Running the same command without the trailing slash does nothing. How can the file be deleted? 回答1: As far as I know, it can't be done using s3cmd. It

Delete a file from s3 bucket

非 Y 不嫁゛ 提交于 2020-08-26 15:25:13
问题 I've created an upload and download service in php-symfony2. This is working fine. Now I want to delete the uploaded file. Any Example? Note: No data storing to database tables. 回答1: Deleting One Object (Non-Versioned Bucket) Create instance of S3 client using Aws\S3\S3Client class factory() . $s3 = S3Client::factory(); Execute the Aws\S3\S3Client::deleteObject() method with bucket name and a key name. $result = $s3->deleteObject(array( 'Bucket' => $bucket, 'Key' => $keyname )); If versioning

Error while trying to upload File into S3 :No 'Access-Control-Allow-Origin' header is present on the requested resource

三世轮回 提交于 2020-08-26 10:34:09
问题 I am trying to upload a file from an application to S3. and i am getting the below error Access to XMLHttpRequest at 'https://yellow-pages-bahrain.s3.amazonaws.com/Chrysanthemum?AWSAccessKeyId=******************&Content-Type=jpg&Expires=1595840227&Signature=knHfUhZ7kqvWLAQlfsbCpzY96as%3D' from origin 'http://localhost:3003' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested

Error while trying to upload File into S3 :No 'Access-Control-Allow-Origin' header is present on the requested resource

故事扮演 提交于 2020-08-26 10:32:06
问题 I am trying to upload a file from an application to S3. and i am getting the below error Access to XMLHttpRequest at 'https://yellow-pages-bahrain.s3.amazonaws.com/Chrysanthemum?AWSAccessKeyId=******************&Content-Type=jpg&Expires=1595840227&Signature=knHfUhZ7kqvWLAQlfsbCpzY96as%3D' from origin 'http://localhost:3003' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested