-2
Currently I have a script that I get the image from a post like this:
$amazonS3 = new AmazonAwsS3;
$amazonS3->uploadFile($_FILES['anexo']['tmp_name'], $_FILES['anexo']['name'], "sig/$class/$idAmdamento");
but instead of me taking this file from a POST, I now need to take the file inside a directory and upload it to the amazonS3, but I’m not able to do it. tried to read with file(), readfile(), file_get_content() ex: $arquivo = readfile('../arquivos/chamados/anexo_1377633937.jpg');
but the array comes empty....
in this case I can download the image, but I can’t read the image and store it in the PHP temp to send it to another location
header('Content-Description: File Transfer');
header('Content-Type: application/force-download');
header ('Content-Disposition: attachment; filename='.$a->getArquivoNome().';');
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header ('Content-Length: '.filesize('../arquivos/chamados/'.$a->getArquivo()));
ob_clean();
flush();
readfile('../arquivos/chamados/anexo_1377633937.jpg');
someone can help me? :)
Man, thank you so much, I know the formulation of my question was not good, but you took the time to answer it and helped me very much, thank you.
– Anj Junior