ContentType to image/jpeg not working

Hi,

Using Webbroker and I set ContentType = 'image/jpeg'

But, when I test to see what the client end is getting, it's 
image/jpeg;charset=ISO-8859-1

Why does it add the "charset=ISO-8859-1" ?

The cloud service I'm using does not like the added "charset=ISO-8859-1".

How do I set it so that it's ONLY "image/jpeg"??

Joe
0
Joe
4/22/2015 2:23:10 PM
embarcadero.delphi.winsock 1874 articles. 2 followers. Follow

3 Replies
911 Views

Similar Articles

[PageSpeed] 53

Joe wrote:

> Using Webbroker and I set ContentType = 'image/jpeg'
> 
> But, when I test to see what the client end is getting, it's
> image/jpeg;charset=ISO-8859-1
> 
> Why does it add the "charset=ISO-8859-1" ?

Please show the rest of your code that is populating the WebBroker object.

-- 
Remy Lebeau (TeamB)
0
Remy
4/22/2015 4:36:20 PM
Below is the event handler for the /Media path info.
(I realize that the memoryStream is not freed at the end and the code returns same jpg no matter what id) 

You can get the picture at:  http://sms.projectone.ca/Media?id=5


procedure TWebModule1.WebModule1waiMediaAction(Sender: TObject;
  Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
var
  ms: TMemoryStream;
  id: String;
begin
  ms := TMemoryStream.Create;
  id := Request.QueryFields.Values['id'];

  DataModule1.Log.WriteTimeStamp(lctCallControl, lptImportant, 'Media action: ' + id);

  if (id = '5') then
    ms.LoadFromFile('balls.jpg')
  else
    ms.LoadFromFile('balls.jpg');

   ms.Position := 0;

  Response.ContentType := 'image/jpeg';

  DataModule1.Log.WriteTimeStamp(lctCallControl, lptImportant, 'Media ContentType: ' + Response.ContentType);
  Response.ContentStream := ms;

  Response.ContentType := 'image/jpeg';

  Handled := True;
end;





> {quote:title=Remy Lebeau (TeamB) wrote:}{quote}
> Joe wrote:
> 
> > Using Webbroker and I set ContentType = 'image/jpeg'
> > 
> > But, when I test to see what the client end is getting, it's
> > image/jpeg;charset=ISO-8859-1
> > 
> > Why does it add the "charset=ISO-8859-1" ?
> 
> Please show the rest of your code that is populating the WebBroker object.
> 
> -- 
> Remy Lebeau (TeamB)
0
Joe
4/22/2015 7:36:39 PM
Below is the event handler for the /Media path info.
(I realize that the memoryStream is not freed at the end and the code returns same jpg no matter what id) 
Using Delphi XE6, Update 1.

You can get the picture at:  http://sms.projectone.ca/Media?id=5


procedure TWebModule1.WebModule1waiMediaAction(Sender: TObject;
  Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
var
  ms: TMemoryStream;
  id: String;
begin
  ms := TMemoryStream.Create;
  id := Request.QueryFields.Values['id'];

  DataModule1.Log.WriteTimeStamp(lctCallControl, lptImportant, 'Media action: ' + id);

  if (id = '5') then
    ms.LoadFromFile('balls.jpg')
  else
    ms.LoadFromFile('balls.jpg');

   ms.Position := 0;

  Response.ContentType := 'image/jpeg';

  DataModule1.Log.WriteTimeStamp(lctCallControl, lptImportant, 'Media ContentType: ' + Response.ContentType);
  Response.ContentStream := ms;

  Response.ContentType := 'image/jpeg';

  Handled := True;
end;





> {quote:title=Remy Lebeau (TeamB) wrote:}{quote}
> Joe wrote:
> 
> > Using Webbroker and I set ContentType = 'image/jpeg'
> > 
> > But, when I test to see what the client end is getting, it's
> > image/jpeg;charset=ISO-8859-1
> > 
> > Why does it add the "charset=ISO-8859-1" ?
> 
> Please show the rest of your code that is populating the WebBroker object.
> 
> -- 
> Remy Lebeau (TeamB)
0
Joe
4/22/2015 7:38:31 PM
Reply:

Similar Artilces:

How (and when) is an image cached for an ASPX with ContentType = image/jpeg ?
I have a page 'GetImage.aspx' which takes 3 query string parameters: ID, Height, and Width. It uses the ID to retrieve binary image data from the database then scales the image to the given height and width. The content type for the page is set to "image/jpeg" so I can use this page as the url for an <img> tag or ImageButton control. Examples: <asp:ImageButton id="img" runat="server" ImageUrl="GetImage.aspx?ID=12345&Height=120&Width=200" /><img src=http://www.somedomain.com/GetImage.aspx?ID=12345&Height=120&...

Delphi XE4 IOS: Download image and assign to image not working
In my App i download a image from URL and then assign it to a image at runtime. It works fine on Windows but on the IOS app the image display is jibberish... The downloaded image formats are jpg and png's. Any hints? // Download image from url function DownloadImage(const URL : String): TBitMap; var HTTP : TIdHttp; Stream : TStream; BitMapSurf : TBitmapSurface; begin HTTP := TIdHttp.Create(nil); try Stream := TMemoryStream.Create; try HTTP.Get(URL, Stream); Stream.Position := 0; BitMapSurf := TBitmapSurface.Create; TBitmapCodecManag...

Delphi XE4 Treeview and Image OnClick not working properly?
Hi! I'm having trouble with Delphi XE4 and TreeView with stylebook. I add a rss feed to a treeview with texts and pictures. That works ok, but i want to add a link to high resolution images on the pictures shown in treeview. Image OnClick only works on the first item in the treeview. In other words the rest of the items images is not clickable... Any ideas ? // myCustomItem Treeview Style // Icon : TImage; // Text : TText; // PubDate : TText; // Picture1 : TImage; type TRSSItem = record Text : String; LowResLink : String; HiResLink : String; PubDate ...

How to load database with 1000 jpeg images in Delphi 2010 ?
Does anyone know of an easy way to load a database with 1000 jpeg images ? Can the same be done for flash (flv files) ? Any help is always appreciated Richard Richard Caruana wrote: > Does anyone know of an easy way to load a database with 1000 jpeg images ? > Can the same be done for flash (flv files) ? What database? What data access framework are you using? Where are the jpg files? If, for instance, you have all your image files in one folder, you could loop thru them and easily load them into just about any database, creating a new record with a blob for each...

Custom control: Response.ContentType = "image/jpeg" ?
Hello,Is is possible to make a custom control where it's output is an image?  When I try to do this the image works fine, but then all the html controls disappear from the page.  I assume it's because the custom control's contenttype is set to image, and that overrides the rest of the page.   I am trying to make something like a captcha control, where I pass it some text to make an image out of.  I'm guessing I need to make a custom control that consists of an image tag that calls an .aspx page who's output is an image.  But then how do I pass it ...

JPEG image over Tranparent Image problem
Hi, I am just started my career as a developer few months back  and I am in my first project and I am struck. Please help. I am developing  a website with asp.net and C# In one of the web page, in an Image control, I have to display an image over an other image which I sucessfully did with various code articles help from the web. Now, in one scenario I have to place a smaller image first. Then over that I have to place a gif image(in which there is a circle transparent area). It is something like placing a photo in a photoframe. With some help from the web, I am able to d...

Response.ContentType = "image/jpeg" but ie tries to save picture as bmp
Hi folks;a.aspx  ..... Response.ContentType = "image/jpeg";Response.OutputStream.Write(data, 0, data.Length); Response.OutputStream.Flush(); b.aspx  .......<img id="ScreenShotImage" src="a.aspx" style="border-width:0px;" /> everthing is fine so far. In ie i can see the picture but when i try to save the picture it tries to save it as bmp. Also "Save as type.." has only "bmp" option.firefox; it tries to save it as png. I checked response headers and everything is fine with it. ContentType is "image...

deep link to JPEG image doesn't show in Firefox (only garbage), but works in Safari
Hi folks When I go to http://ibunker.us/f24021275723868.jpg -> right click, display graphic -> http://ibunker.us/pics/439962/24021275723868.jpg -> its shows me some weired garbage characters: http://i.imgur.com/T2XzB.png Anybody else have the same problem? It's a problem local to me? How to solve? With Safari it works. cheers Sven Sven Aluoor wrote: > Hi folks > > When I go to http://ibunker.us/f24021275723868.jpg -> right click, > display graphic -> http://ibunker.us/pics/439962/24021275723868.jpg -> > its shows me some weired garbage...

Images work fine with while debugging but do not work on Internet
Dear Forum, I have a simple problem that plagues my website. Every time I want to put in an image I can't get it to display on the internet. It looks fine on the Intranent and I believe the files are in the right spot any ideas? I am using VWD, and VB code. IO have tried jpeg, gif, and all sorts of other images and still nothing.   Thank You, TIM  Did you reference the images correctly? Do your images display if you open the path which is specified in <img src="path" /> ??? You can use the Tilde-Operator for application realtive pa...

Modify a working Delphi XE4 installation does not work
Hello, i need to upgrade the intraweb component in Delphi XE4 to the official atozed license. The info from atozed is first to uninstall the bundled version. But when i start the installation wizard from XE4 and select modify, a message "serial number unvalid" appears and i can only stop with taskmanager. What can i do. Thanks Theo Ok, i found the solution myself. Here is how it goes: http://support.embarcadero.com/article/43089 ...

Delphi 5 Image & ASA Image
Hi. I am facing problems on writing and reading Delphi image to ASA 6.03(2984) image field. I wrote a simple application with TTable component connected to a table with an image field, the writing is going well (I think), but when I try to read the image with my application I am getting "Invalid Blob Length". Any Idea why, as I remember in ASA 5.xxx it worked well. Best Regards. Yossi Zaig. Are the 'Keys in SQL Statistics' and 'Prevent Driver Not Capable Errors' checkboxes checked in your ODBC DSN? If they are not, you could get the error you...

Insert image feature DOES NOT WORK with resized images
Name: Steve Email: mindcontrolcentralatcomcastdotnet Product: Thunderbird Summary: Insert image feature DOES NOT WORK with resized images Comments: As my summary states, the insert image feature (of Thunderbird) does not work if you resize your image (using the custom size function found in the Image Properties Window). It appears to work, and Thunderbird acts as if the email is sent, BUT IT IS NOT. I repeat, no email is sent! I've used the feature many times, and each time, the email appears to be sent - but NO ONE RECIEVES IT! I finally found this out the h...

image/jpeg, image/tiff content type
Hi, I am having problem when I try to attach a .jpg and .tiff/.tif image in my email program. I have allowed image/jpeg and image/tiff content type but it still says invalid attachment. I have even tried image/jpg and image/tif content type but it still doesnt work..jpeg image can be attached without any error. Can anybody help? Thank you in advance....

Does image cache still work if the same image is resized
Hi I was wondering if anyone could help.I currently have a website that displays images, first as a grid of thumbnails and then when the user clicks on the image it shows them the full sized image. Currently these images are read from a server then resized and finally uploaded to the server. Currently I have the image resizer making two copies one thumbnail and one full size (although still resized from 1200x1200 to 600x600)I was wondering though if I was to use one image (the 600x600) and resize that to 120x120 using the <img style="width:120px; height:120px;" /> would cache...

Web resources about - ContentType to image/jpeg not working - embarcadero.delphi.winsock

Library - Wikipedia, the free encyclopedia
A library is an organized collection of books , other printed materials, and in some cases special materials such as manuscripts, films and other ...

Library - Wikipedia, the free encyclopedia
A library is an organized collection of books , other printed materials, and in some cases special materials such as manuscripts, films and other ...

Limburg.be - Welkom op de site van de provincie Limburg - Welkom_op_de_site_van_de_provincie_Limburg
visit wonen werken leven ontspannen infopunt home op trefwoord contactpersonen wegwijs sitemap print deze pagina Je bent hier: limburg.be Contact ...

Season 1 Sneak Preview: The Pitch
Watch The Pitch season 1 sneak peek in its entirety for free on AMCtv.com: Two agencies compete in a battle to find the next big…

Making your ASP.NET Web API’s secure
... wished to initiate a request from your C# code, you might have a utility method like this: WebRequest getRequest(string method, string contentType, ...

Why Obama's $90 Billion Bank Tax Is Fair Play
The White House is poised to propose a $90 billion tax on big banks to recoup losses from the Troubled Asset Recovery Program (TARP). After all ...

Derrick Petzold
; Open source enthusiast and developer from django.contrib.auth.models import User from django.contrib.contenttypes import generic from djan ...

Digital Worldwide Partner Community - Get Involved - Partner Perspectives
Join the Microsoft Partner Network Community; we are building a community that is all about you. Connect with other partners and Microsoft to ...

Phaxio integration using HttpClient & ASP.NET MVC
... ( ( requestTask ) { var response = requestTask . Result ; response . EnsureSuccessStatusCode (); response . Content . Headers . ContentType ...

Travel guides for every budget, interest, season and holiday - Travel - Disney Family.com
Check out our family vacation ideas with trips perfect for summer vacation, winter break, spring break, holiday travel, weekend getaways, and ...

Resources last updated: 2/12/2016 3:12:33 AM