HTML Media “Content-Disposition” is turned to “attachment”
-
Hi,
I noticed that when I turn on protection for HTML files, their HTTP Content-Disposition is changed to “attachment”. This leads to the files being downloaded instead of displayed in the browser. The standard behavior of WordPress seems to be to return HTML media files “inline”. I think it would be best if the plug-in would maintain that standard behavior.
if ( is_image( $file ) == false && is_pdf( $mimetype ) == false && is_video( $mimetype ) == false && is_audio( $mimetype ) == false ) { $file_name = wp_basename( $file ); header( "Content-Disposition: attachment; filename=$file_name" ); }
The above code snippet from ‘download.php’ could be updated to check if a file is an HTML file in order not to apply the change to the Content-Disposition.
Thank you!
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘HTML Media “Content-Disposition” is turned to “attachment”’ is closed to new replies.