How to upload a file to AWS S3 bucket from CakePHP 3.0? - amazon-s3

I have used S3 bucket to upload documents from my CakePHP 2.0 Web Application.
Right now I am facing problem to upload from CakePHP 3.0 Shell script.
I get Fatal Error: Class S3 not found in App\Shell\S3.php,
I have googled a lot, I have tried to use S3 SDK but if you try to use S3 class in your Shell script I get above error.
Please let me know if I am missing something, any help will be appreciated.

Your issue looks like a problem with autoloading the S3 SDK. Have you included the S3 SDK's autoloader properly?
Anyway, I'd recommend PHP league's flysystem for a very easy-to-use abstraction of S3: https://github.com/thephpleague/flysystem-aws-s3-v3

Related

How can I download a file from an S3 bucket with wget by Object owner?

I am a beginner in aws and I have a problem.
Problem is:
Is it possible to download an object from S3 bucket via the object owner using the wget command from Elastic container service?
I have defined the policies, but it seems that these policies have no effect and aws considers the download request from outside and does not find the object and issues a 403 message.
Is there any other solution?
Thank you in advance for the answer.

Issues writing to S3 using s3-streamlogger

I'm writing in NodeJS and trying to send winston log data to S3 bucket using s3-streamlogger, but I get access denied.
Testing it from the CLI it is working fine read and write. the only reason I can think of is that we are using MFA in our AWS account.
Any ideas? workarounds?
Thanks

How to use Amazon S3 as Moodle Data Root

I am trying to move my moodledata folder content into Amazon S3. i didnt found any document (or guide) to configure this setup.
I am using MOODLE 3.3 STABLE build version.
Can anyone help me to setup this?
You could use s3fs and mount it on your webserver.
I suggest to use local directory (for performance) to:
cache, localcache and sessions

Upload file to Amazon S3 and assign callback for percentage uploaded

Is there an easy way to assign callback function for percentage uploaded in PHP - Amazon s3.
Something similar to this
File Download
but for upload?
The AWS SDK for php 1.2.6 includes a runnable sample in _samples/cli-s3_progress_bar.php.
which shows tracking upload/download progress.
Download here
http://aws.amazon.com/releasenotes/PHP/1553377899765189

broken pipe error with rails 3 while trying to upload data to AWS-S3

I am trying to upload some static data to my aws s3 account.
I am using aws/s3 gem for this purpose.
I have a simple upload button on my webpage which hits the controller where it create the AWS connection and tries uploading data to AWS S3.
The connection to the AWS is successful, how-ever while trying to store data in S3, i get following error : Errno::EPIPE:Broken pipe" ...always.
I tried running the same piece of code from s3sh (S3 Shell) and i am able to execute all calls properly.
Am i missing something here?? its been quite some time now since i am facing this issue.
My config are : ruby 1.8, rails 3, mongrel, s3 bucket region us.
any help will be great.
I think the broken pipe error could mean a lot of things. I was experiencing it just now and it was because the bucket name in my s3.yml configuration file didn't match the name of the bucket I created on Amazon (typo).
So for people running into this answer in the future, it could be something as silly and simple as that.
In my case the problem was with the file size. S3 puts a limit of 5GB on single file uploads. Chopping up the file into several 500MB files worked for me.
I also had this issue uploading my application.css which had compiled file size > 1.1MB. I set the fog region with:
config.fog_region = 'us-west-2'
and that seems to have fixed the issue for me...