php - Symfony - BinaryFileResponse returns a ResponseHeader, but no file -


currently trying serve static pdf file not within web directory ($reasons).

i applied

$filepath = $this->gettargetfile($level, $name);  $response = new binaryfileresponse($filepath); $response->headers->set('content-type', 'application/pdf'); $response->setcontentdisposition(     responseheaderbag::disposition_inline,     $filename ); return $response; 

and profiler shows there response correct headers, there no document view , no download prompt whatsoever. there missing?

/** target file */ public function gettargetfile($level, $name) {     return $this->kernel->locateresource($staticpath . $level . '/' . $name); } 

some nerves spent, but:

i created form via javascript , submitted needed parameters new window (thanks this), made job. if has "cleaner" solution, i'm open suggestions :)


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -