File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 120120
121121 $ response ->headers ->set ('Content-Type ' , $ attachment ->getMimeType ());
122122 $ response ->headers ->set ('Content-Length ' , $ attachment ->getFilesize ());
123- $ response ->headers ->set (
124- 'Content-Disposition ' ,
125- 'attachment; filename=" ' . rawurlencode ($ attachment ->getFilename ()) . '" '
126- );
127- $ response ->headers ->set ('Content-MD5 ' , $ attachment ->getRealHash ());
128123
124+ if ($ attachment ->getMimeType () === 'application/pdf ' ) {
125+ $ response ->headers ->set (
126+ 'Content-Disposition ' ,
127+ 'inline; filename=" ' . rawurlencode ($ attachment ->getFilename ()) . '" '
128+ );
129+ } else {
130+ $ response ->headers ->set (
131+ 'Content-Disposition ' ,
132+ 'attachment; filename=" ' . rawurlencode ($ attachment ->getFilename ()) . '" '
133+ );
134+ }
135+
136+ $ response ->headers ->set ('Content-MD5 ' , $ attachment ->getRealHash ());
129137 $ response ->send ();
130138} else {
131139 $ attachmentErrors [] = Translation::get ('msgAttachmentInvalid ' );
You can’t perform that action at this time.
0 commit comments