Content-Type in Floatbox

Page: 1

Author Post
Member
Registered: Jun 2014
Posts: 8
Hello,

I am uploading few image files on my server. It is uploaded properly. I see the files on the server. Then I render it on the webpage with floatbox. But some images render ok while some others dont. I fail to understand the reason. When I click on Floatbox, for the images that dont render, I see the content-type as text/html in browser header info instead of image/jpeg. I have my mime-type set up appropriately in Tomcat. Is it possible that Floatbox is changing the content-type somehow. My code snippet is as follows:

<td>

<a href="/HImages/${image.imageName}" class="floatbox" title="${image.imageDesc}" data-fb-options="caption2:Figure${image.imageNum} contentBackgroundColor:black; colorTheme:blue; width:1000px; height:720px; onclick="fb.start(this); return false;"><img src="/HImages/${image.imageName}" width="200px" /></a>

</td>


Any help/insight, would greatly appreciate it. I have been facing these problem for few days now, but unable to find suitable solution.

Thanks,
Priti
Administrator
Registered: Aug 2008
Posts: 3382
I would need to see the page online to determine why some images are not being displayed.

Content-Type is a header that the server sends to the browser along with the file content. Floatbox does not and cannot affect that.

Servers typically associate Content-Type with file extensions. If some of your images come in as image/jpeg and some come in as text/html, I suspect that some of them must have inappropriate or missing file extensions (i.e., not .jpg).
Member
Registered: Jun 2014
Posts: 8
Thank you for your responses for my this and previous question about video not getting played. I think the problem is the same for both - content-type is not getting correctly picked up by the browser. I have a webpage where I am uploading image and video files on same page and then displaying image and video files in another page. When I look into the developers tool in browser the problem images are set as text/html and video as octet/(something), instead of image/jpeg and video/mp4. But when I manually copy these image/video files instead of uploading it to the server location, images/video files are displayed properly. I am using AJAX/Jquery technology. Since Iam using Floatbox for these images/videos on one page, do you have a demo of some sort which tells me how to set content-type for image and video on the same page?

Thanks so much,
Priti
Administrator
Registered: Aug 2008
Posts: 3382
The content-type header is not something that is manipulated at the client side. It is a server configuration task to associate mime types with file extensions.

If you're serving from Apache, you could try a web search with keywords like "apache content-type mime type htaccess".

Page: 1