0

I'm trying out a Laravel wrapper for CloudConvert, so I'm using one of the examples from GitHub to check the basic file conversion. My code is the following:

$path = storage_path('app');
CloudConvert::file($path.'/test.jpg')->to($path.'/test.pdf');

so basically I want to convert test.jpg file to test.pdf. Both source and output files should be taken from/saved under storage/app.

Thing is, the conversion takes place but the output file is not being saved under the specified path (nor anywhere in the project). I know the conversion is successful, because I can see it in my CloudConvert account, and I can download the PDF after conversion from CloudConvert directly.

What am I doing wrong? Why isn't the output file stored?

I also tried to change the destination path to use public directory - no luck.

muenchdo
  • 2,161
  • 1
  • 17
  • 30
lesssugar
  • 15,486
  • 18
  • 65
  • 115
  • Hello @lessugar, It's strange that the file isn't getting saved to disk. You mentioned you're using Homestead in your email so your permissions should be fine. What version of Homestead / Laravel are you using? I'll try to reproduce – RobbieP May 26 '16 at 13:03
  • @RobbieP Homestead 0.2.7, Laravel 5.2. I also tried to convert and save on my public server - same thing: converted file is there to download only on CloudConvert direclty. I also tried the non-blocking way with no success (https://github.com/robbiepaul/cloudconvert-laravel#non-blocking-conversion-using-a-callback-url). – lesssugar May 26 '16 at 13:19
  • 1
    Yea, it seems it was a bug introduced in the last release. The 'wait' option was being set to `false` on local files which was causing the process to exit before the file could be saved. I've released a patch, so just do a `composer update robbiep/cloudconvert-laravel` and it should fix it. Thanks for pointing it out! – RobbieP May 26 '16 at 14:33
  • 1
    Just checked it and it works. Thanks a lot! – lesssugar May 26 '16 at 14:43

0 Answers0