Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error throwing: File does not exists but It exists on AWS S3 bucket #22

Open
itsdeo opened this issue Sep 3, 2020 · 3 comments
Open

Comments

@itsdeo
Copy link

itsdeo commented Sep 3, 2020

Hi There,

I am implementing Office-converter to convert PPT to PDF but I am getting error like

message: File does not exist --http://s3-eu-west-2.amazonaws.com/SomeDirName/SomeFile.ppt
I checked file is exists but showing above error message.

I used code like :
$converter = new OfficeConverter($request->s3_url);
$converter->convertTo('output_file.pdf'); //generates pdf file in same directory as test-file.docx

Please help me on this

Thank you!

@php-
Copy link

php- commented Jan 13, 2021

Looking for the same case,
Any help?

@fd6130
Copy link

fd6130 commented Jul 19, 2022

Wait.. Isn't it this library only works in local filesystem? I think you need to download the s3 file to a temp path and use that path to convert.

@Meet0001
Copy link

Meet0001 commented May 6, 2024

You can download the file from s3 into your local machine using the following code.
function loadFile($templateFile,$fields,$results){
try{
$headers = @get_headers($templateFile);
if ($headers && strpos($headers[0], '200') !== false) {
$localfilepath = envpath("common"). "assets/tmp/dummy_". time() . ".pptx";
if($contents = file_get_contents($templateFile)){
file_put_contents($localfilepath, $contents);
}
}
}
}

After all the processing, you can delete the downloaded file using unlink function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants