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)

Hi Codee,

I noticed that the server is sending webp files as an incorrect mimetype of

application/octet-stream

instead of being image/webp. Think of mimetypes as a way for a server to tell a browser the type of file it is. This means when the browser encounters such a file it will do something different than other file types. Some browsers will just download the file (which seems to be the default for Chrome) while others will open it in a new tab (which seems to be the default for Firefox). 

I think the solution here is for the server to make sure it is serving webp files with the correct mimetype. It is probably not this way by design and needs a simple mimetype association on the web server to fix it. It is nothing wrong on your side. 

I think you caught a nice little oddity here. :)

Tim Hurd
Senior Application Developer
TimHurd.com

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