Just noticed within this forum regarding uploaded files this issue. Is it designed intentionally this way?

7 posts by 4 authors in: Forums > CMS Builder
Last Post: July 23   (RSS)

As I was reviewing this forum I noticed an interesting effect. If I click on an attached file, the "target" is different depending upon the file type. If the uploaded attachment is a .jpg or .png the mouse click opens up in the same window. If I click on an attachment that is a .webp it opens in a new window.  Is this by design?

I believe that is caused by a browser setting. Check your settings on how each file type is handled.

Jeff Shields

Jeffs comment is also the other side of the coin. Once the correct mimetype is associated on the server, then on your browser you can choose how you want to handle that webp file type (downloads vs open in same tab etc.)

Nice addition Jeff. :)

Tim Hurd
Senior Application Developer
TimHurd.com

Thanks, Jeff. 

Tim,

Thank you for jumping in and addressing my post quickly, accurately and effectively. I appreciate not only you and Jeff, but the entire IT team led by Mr. Dave. 

Hi All,

Thanks for noticing this and for all the feedback and insights.  

I added the mimetype to the simpleForum.php function sforum_downloadForumAttachment() as follows: 

  // get content-type for showing files inline
  $inlineExtToHeader = array(
    'gif'  => 'image/gif',
    'jpg'  => 'image/jpeg',
    'jpeg' => 'image/jpeg',
    'png'  => 'image/png',
    'webp' => 'image/webp',
  );

So webp files should display inline now without forcing you to download them.

Thanks!

Dave Edis - Senior Developer
interactivetools.com