I currently have a feature that grabs an mp3 file from a remote URL and loads it into an Amazon S3 bucket.
The function works fine since the file appears in S3, however I am worried that when testing this on my local server using the tunnel (ngrok) the page does not seem to return any HTTP status.
It returns 200 when I first upload the file locally and then upload it. Since we are dealing with large audio files, I am trying to make the first idea work in that it is more efficient (I think).
Is there a way to get the page to return an HTTP status code, and should I be worried that this is not the case at present?
Here is a snippet of code using the Amazon SDK V2 in PHP
$config = array('key' => AMAZON_S3_KEY,'secret' => AMAZON_S3_SECRET,'region' => 'us-west-2'); $s3 = Aws::factory($config)->get('s3')->registerStreamWrapper(); $s3->putObject(array( 'Bucket' => 'mybucket', 'Key' => 'filename.mp3', 'ContentLength' => $size, 'Body' => fopen($url, 'r') ));
thatguy
source share