cancel
Showing results for 
Search instead for 
Did you mean: 

php client download image file

sk90_
Champ in-the-making
Champ in-the-making

Hi,

How do I download an image file using the php client? I tried something like this:

$answer = $this->session->NewRequest("Blob.Get")->Set('input', 'doc:' . $path)->SendRequest();

header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename='.end(explode("/", $path))); readfile('tempstream');

But the downloaded file is not a valid image file. I tried changing the content-type to image/png as well. What am i missing?

Thanks

1 REPLY 1

sk90_
Champ in-the-making
Champ in-the-making

I was able to fix this by changing readfile('tempstream') to echo $answer.