The media type and the extension
The IANA registration identifies WebP as image/webp. A name such as photo.webp is a filename; image/webp is a media type. A renamed JPG remains JPEG data, and a genuine WebP can have an unhelpful filename.
Before changing a declaration, establish what the file actually contains. A mismatch may require correcting a name or header. A receiver that does not accept the underlying image format requires a real conversion instead.
HTTP: inspect the response that delivers the image
The HTTP specification defines Content-Type as the representation’s media type. A response serving WebP image bytes should use the following header. This is an illustrative response header, not a complete server configuration.
Content-Type: image/webpIn the browser’s network inspector, locate the actual image request, check its final URL and response status, and inspect the response headers. Confirm the body is an image rather than an error page or sign-in response. Changing a header on an HTML error response does not turn it into a picture.
If a proxy or cache serves a different response from the origin, inspect the delivered response as well as the origin configuration. Make a change only after identifying which layer supplies the wrong declaration.
HTML: distinguish image selection from upload filtering
The HTML picture model allows a source element to declare its media type while the img element supplies a fallback. These paths are illustrative assets you would replace with your own files.
<picture>
<source srcset="/images/photo.webp" type="image/webp">
<img src="/images/photo.jpg" alt="A mountain lake">
</picture>The HTML file-input specification defines accept as a file-selection hint. It does not set an image response header, convert the selected file or replace server-side validation.
<input type="file" accept="image/webp,.webp">Continue with using WebP on websites for broader image-delivery decisions after the declaration is correct.
Check the MIME type WebP files declare when a receiver refuses them
First read the receiving form’s allowed formats. Next compare the real file content, filename and reported type. Finally separate upload acceptance from image display: a browser may display a file that a particular service refuses to store.
If the service accepts WebP but the declaration is wrong, correct the responsible response or upload metadata. If the service accepts only JPG or PNG, convert WebP to JPG or convert WebP to PNG. A different Content-Type string cannot add unsupported format handling.
For a file that is accepted but does not display, check the actual response and WebP browser support. Rejection by one form does not, on its own, establish corruption.
Questions and answers
Media types, file extensions and rejected uploads.
No. It is a media type. The usual filename extension is .webp.
No. The declaration should match the actual data. Convert the image when the receiver requires JPEG.
Not necessarily. Allowed-format rules, file validation and transport declarations can also cause rejection. Check the specific error and requirements.