I have a method that successfully uploads local files to an S3 bucket using the amazon SDK, all I need is a valid local path/to/file
, which is the second param below:
$this->saveToAmazon($pathOnS3,$filename);
These local files are uploaded by the user and handled using the $_FILES
global. Once the user uploads, we are copying to a local uploads
folder via move_uploaded_file()
. From there, we are calling the above function. This works fine, although this got me thinking.
Since for the life of the request, the file can be accessed temporarily via $_FILES['file']['tmp_name']
, is it possible to 'hack' together a temporary valid file path to provide the saveToAmazon()
function without having to call move_uploaded_file()
and using the local uploads folder? essentially tapping in to the local php/tmp
directly?