The code below downloads the current file, I need it to open the file in a new tab, what needs to be added in order to do so?
public function submitForm(array &$form, FormStateInterface $form_state) { $filename = '/var/www/html/web/modules/custom/custom_module/sample.pdf'; $response = new BinaryFileResponse($filename); $response->setContentDisposition( ResponseHeaderBag::DISPOSITION_ATTACHMENT, 'sample.pdf' ); $form_state->setResponse($response);