Search
 
SCRIPT & CODE EXAMPLE
 

PHP

how to download file from s3 bucket using php

Got it to work by echo'ing out the content-type header before echo'ing the $object body.

$objInfo = $s3->get_object_headers('my_bucket', 'test.jpg');
$obj = $s3->get_object('my_bucket', 'test.jpg');

header('Content-type: ' . $objInfo->header['_info']['content_type']);
echo $obj->body;
Comment

PREVIOUS NEXT
Code Example
Php :: Doctor Strange 
Php :: validate either one field is required in laravel 
Php :: download xampp php 7.3 
Php :: Gravity Form Shortcode Wordpress 
Php :: laravel copy data 
Php :: Call to undefined function GuzzleHttp\_idn_uri_convert() 
Php :: php - = 
Php :: wp_customize image 
Php :: php run command terminal 
Php :: integer data type php 
Php :: laravel 9 excel 
Php :: download file laravel s3 
Php :: how to install apache mysql php on ubuntu 18.04 
Php :: laravel rule unique where 
Php :: laravel bootstrap navbar active 
Php :: create a module laravel 
Php :: laravel pivot table model 
Php :: epoch to date php 
Php :: creating default object from empty value laravel 
Php :: api resource create in laravel 
Php :: php namespace class 
Php :: php api 
Php :: touches in laravel 
Php :: if statement php 
Php :: laravel how to nested foreach 
Php :: date and time syntax 
Php :: Simple factory Design pattern in PHP 
Php :: php public folder 
Php :: cara membuat koneksi php 
Php :: wc php product_cat thumbnail 
ADD CONTENT
Topic
Content
Source link
Name
4+8 =