file - Symfony can't return tmpfile -
i return file download user in api. i'm using
$response = new binaryfileresponse($filepath); $response->setcontentdisposition( responseheaderbag::disposition_attachment, 'my_filename.pdf' ); this works when$filepath points toward saved file on disk. however, when using
$tempfile = tmpfile(); fwrite($tempfile, file_get_contents($url)); i following error
the file "/tmp/phpxom4sh" not exist i don't know problem is, , why httpfoundation\file class throws error.
any appreciated
edit: after further inspection, binaryfileresponse created, error occurs when return response.
side note: i'm using fosrestbundle. suppose bundle closing pointer file or alike in process, why file isn't accessible anymore.
Comments
Post a Comment