# Programming question (ASP.NET): HtmlInputFile mimetype of image/jpeg vs image/pjpeg?

**URL:** <https://boards.straightdope.com/t/programming-question-asp-net-htmlinputfile-mimetype-of-image-jpeg-vs-image-pjpeg/270200>\
**Category:** Factual Questions\
**Created:** [October 20, 2004, 12:24pm UTC](https://boards.straightdope.com/t/programming-question-asp-net-htmlinputfile-mimetype-of-image-jpeg-vs-image-pjpeg/270200 "2004-10-20T12:24:18Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![fighting\_ignorant](https://avatars.discourse-cdn.com/v4/letter/f/ac8455/32.png) [@fighting\_ignorant](https://boards.straightdope.com/u/fighting_ignorant)\
**Post date:** [October 20, 2004, 12:24pm UTC](https://boards.straightdope.com/t/programming-question-asp-net-htmlinputfile-mimetype-of-image-jpeg-vs-image-pjpeg/270200/1 "2004-10-20T12:24:18Z")

</div>

I have an [ASP.NET](http://ASP.NET) page with an HtmlInputFile control. On certain machines,  
when a user uploads a jpeg image, the uploaded file has a MIME type of  
image/jpeg and on others the uploaded file has a MIME type of image/pjpeg.  
What could be causing this difference and how can I make it uniform?

Thanks.

---

<div class="post-metadata">

**Author:** ![chrisk](https://avatars.discourse-cdn.com/v4/letter/c/6de8d8/32.png) [@chrisk](https://boards.straightdope.com/u/chrisk)\
**Post date:** [October 20, 2004, 12:46pm UTC](https://boards.straightdope.com/t/programming-question-asp-net-htmlinputfile-mimetype-of-image-jpeg-vs-image-pjpeg/270200/2 "2004-10-20T12:46:01Z")

</div>

> [@fighting ignorant](#):
>
> I have an [ASP.NET](http://ASP.NET) page with an HtmlInputFile control. On certain machines,  
> when a user uploads a jpeg image, the uploaded file has a MIME type of  
> image/jpeg and on others the uploaded file has a MIME type of image/pjpeg.  
> What could be causing this difference and how can I make it uniform?
> 
> Thanks.

Not familiar with [asp.net](http://asp.net) as such, but you might want to look at the registries of the machines involved…

\HKEY\_CLASSES\_ROOT.jpg[Content Type] contains the MIME type for files with a .jpg extension if I read this right. Adjust accordingly for a .jpeg extension, .jpe, .jfif or any other extension you’re interested in.

Now, as for the deeper question of what set those registry settings differently on different computers and if any software on them is dependent on those settings… that I’m less sure of. Hope this at least points you in the right direction to start.

---

<div class="post-metadata">

**Author:** ![Bruce\_Daddy](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@Bruce\_Daddy](https://boards.straightdope.com/u/Bruce_Daddy)\
**Post date:** [October 20, 2004, 1:06pm UTC](https://boards.straightdope.com/t/programming-question-asp-net-htmlinputfile-mimetype-of-image-jpeg-vs-image-pjpeg/270200/3 "2004-10-20T13:06:32Z")

</div>

Check this out:

[http://www.dotnetcoders.com/web/Articles/ShowArticle.aspx?article=57](http://www.dotnetcoders.com/web/Articles/ShowArticle.aspx?article=57)

---

<div class="post-metadata">

**Author:** ![fighting\_ignorant](https://avatars.discourse-cdn.com/v4/letter/f/ac8455/32.png) [@fighting\_ignorant](https://boards.straightdope.com/u/fighting_ignorant)\
**Post date:** [October 20, 2004, 1:11pm UTC](https://boards.straightdope.com/t/programming-question-asp-net-htmlinputfile-mimetype-of-image-jpeg-vs-image-pjpeg/270200/4 "2004-10-20T13:11:28Z")

</div>

> [@Bruce\_Daddy](#):
>
> Check this out:
> 
> [http://www.dotnetcoders.com/web/Articles/ShowArticle.aspx?article=57](http://www.dotnetcoders.com/web/Articles/ShowArticle.aspx?article=57)

Thanks, but that seems to refer to problems creating Visual Studio Web Projects. To clarify, this problem is a site that has already been created in Visual Studio, and which works one way when deployed on some servers (namely that images uploaded via this HtmlInputFile control have a MIME type of image/jpeg) and differently on other machines (they show up as image/pjepg).

Any more ideas? Thanks in advance…

---

<div class="post-metadata">

**Author:** ![fighting\_ignorant](https://avatars.discourse-cdn.com/v4/letter/f/ac8455/32.png) [@fighting\_ignorant](https://boards.straightdope.com/u/fighting_ignorant)\
**Post date:** [October 20, 2004, 1:15pm UTC](https://boards.straightdope.com/t/programming-question-asp-net-htmlinputfile-mimetype-of-image-jpeg-vs-image-pjpeg/270200/5 "2004-10-20T13:15:37Z")

</div>

> [@chrisk](#):
>
> Not familiar with [asp.net](http://asp.net) as such, but you might want to look at the registries of the machines involved…
> 
> \HKEY\_CLASSES\_ROOT.jpg[Content Type] contains the MIME type for files with a .jpg extension if I read this right. Adjust accordingly for a .jpeg extension, .jpe, .jfif or any other extension you’re interested in.
> 
> Now, as for the deeper question of what set those registry settings differently on different computers and if any software on them is dependent on those settings… that I’m less sure of. Hope this at least points you in the right direction to start.

ChrisK: thanks but no such luck. the extension .jpg is set for image/jpeg, not image/pjpeg

---

<div class="post-metadata">

**Author:** ![chrisk](https://avatars.discourse-cdn.com/v4/letter/c/6de8d8/32.png) [@chrisk](https://boards.straightdope.com/u/chrisk)\
**Post date:** [October 20, 2004, 2:34pm UTC](https://boards.straightdope.com/t/programming-question-asp-net-htmlinputfile-mimetype-of-image-jpeg-vs-image-pjpeg/270200/6 "2004-10-20T14:34:32Z")

</div>

> [@fighting ignorant](#):
>
> ChrisK: thanks but no such luck. the extension .jpg is set for image/jpeg, not image/pjpeg

On the server, or on the client machines uploading??

---

<div class="post-metadata">

**Author:** ![fighting\_ignorant](https://avatars.discourse-cdn.com/v4/letter/f/ac8455/32.png) [@fighting\_ignorant](https://boards.straightdope.com/u/fighting_ignorant)\
**Post date:** [October 20, 2004, 9:44pm UTC](https://boards.straightdope.com/t/programming-question-asp-net-htmlinputfile-mimetype-of-image-jpeg-vs-image-pjpeg/270200/7 "2004-10-20T21:44:13Z")

</div>

> [@chrisk](#):
>
> On the server, or on the client machines uploading??

Both actually
