viewpoint-particle

Author Topic: Returning Image (Binary)  (Read 2339 times)

JTaylor

  • Pundit
  • *****
  • Posts: 804
    • Data & Stuff Inc.
Returning Image (Binary)
« on: August 04, 2015, 07:12:06 pm »
Given

  WebOut("Content-Type: image/jpg",2)
  WebOutBinary(bb)

what do I need to do to make this work in IE?   It works fine in FireFox and Chrome, returning the appropriate image, so I assume my buffer and database request are fine. 

It prompts me to "Open" or "Save" the response.  Hopefully not an IE configuration issue since that would make it unusable :-(

 Seems like I tend to have these type of issues with IE more so than the other browsers but can't remember what I have done to overcome the problem.  Granted I haven't tried this with WebBatch before.   Just dawned on me that I could.


Jim

JTaylor

  • Pundit
  • *****
  • Posts: 804
    • Data & Stuff Inc.
Re: Returning Image (Binary)
« Reply #1 on: August 06, 2015, 08:59:33 am »
Anyone?

Jim

....IFICantBYTE

  • Full Member
  • ***
  • Posts: 119
Re: Returning Image (Binary)
« Reply #2 on: August 06, 2015, 05:53:09 pm »
I'm only answering because no body else did, but I don't have too much to offer...
It's probably presenting just a picture file to the browser, and IE just says, ok, you want to save or open this file... the other browsers interpret that as oh, I can display this, so they do.
If you can somehow wrap some simple <HTML> tags or com .image something code around it to say to IE - render this in your own window, don't treat it as a downloaded file, then I guess it should work?

Sorry, not that helpful I know.

Regards,
....IFICantBYTE

Nothing sucks more than that moment during an argument when you realize you're wrong. :)

JTaylor

  • Pundit
  • *****
  • Posts: 804
    • Data & Stuff Inc.
Re: Returning Image (Binary)
« Reply #3 on: August 06, 2015, 09:56:27 pm »
Yeah...starting to think nobody likes me :'(

I think it will work within HTML.  Tried it earlier with the same thought and worked in an embedded browser...just hadn't got back to here to delete my post.

Thanks.   Hoping someone will respond to my other post as well with a good answer.   That one I haven't been able to crack yet.

Thanks again.

Jim

td

  • Tech Support
  • *****
  • Posts: 2222
    • WinBatch
Re: Returning Image (Binary)
« Reply #4 on: August 08, 2015, 01:57:57 pm »
Can't offer any specific suggestions but when we encounter similar problems on our sites the solution usually involves some kind of mime type change.  Finding a type or types that work for all browsers usually involves some web searching and trial and error testing.
"Success is a lousy teacher. It seduces smart people into thinking they can't lose."
  - Bill Gates


JTaylor

  • Pundit
  • *****
  • Posts: 804
    • Data & Stuff Inc.
Re: Returning Image (Binary)
« Reply #5 on: August 08, 2015, 02:34:21 pm »
Thanks.  I  think it works okay if embedded in a web page.   Just doesn't display directly but if I download what it wants me to save, the image is there so all is working in that sense.   Wish it had dawned on me sooner that I could return such data from WebBatch.  May not have written my WebService server though if that had happened so that is one benefit of me being so dense :-)  Thanks again.

Jim