NetTalk Central

Author Topic: Ping Bruce  (Read 3868 times)

peterH

  • Sr. Member
  • ****
  • Posts: 413
    • View Profile
Ping Bruce
« on: March 10, 2011, 02:40:18 AM »
Hi Bruce,

I mailed you an example app on Tuesday - did you receive it?

Peter

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Ping Bruce
« Reply #1 on: March 13, 2011, 12:56:08 AM »
Hi Peter,

I'm getting your emails ok, but unfortunately your ISP is blocking my replies. If you have an alternate email address, please let me know. Or use this forum. Here's my reply;

Hi Peter,

 
Thanks for the example;
I've fixed a bug for the next release (5.18)
 
you can work-around the issue in your app for now by placing;
 
  p_web.ReplyContentType = p_web._GetContentType('.pdf')
  exit

in the serveDocument procedure, in the Header routine, right at the start of the routine.
 
Cheers
Bruce

peterH

  • Sr. Member
  • ****
  • Posts: 413
    • View Profile
Re: Ping Bruce
« Reply #2 on: March 14, 2011, 06:22:29 AM »
Hi Bruce,

It's indeed a workable solution you're offering.

The only drawback is that the user is now being presented with a prompt screen (do you want to open or save). Without adding this code IE could not serve the file at all whereas FF would simply open the file (which is what I really want).

I was hoping that all browsers could act the way FF does as the app is always serving pdf files and they're always just intended for being displayed to the user. Is this what 5.18 will do or is it merely including the fix you've posted?

Thanks
Peter

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Ping Bruce
« Reply #3 on: March 14, 2011, 09:44:51 PM »
Hi Peter,

On my machine IE behaves the same as FireFox - in other words, the PDF is opened directly in the browser, no questions asked.

So in your case the fault is either in the client machine (ie PDF not installed into the browser maybe, or a setting that forces it to save, not display, PDF files) - or on the server side you are explicitly telling the browser to "not display" the file. This is usually done with the content-disposition header, and in the File Downloads example you'll see a line of code which does this. In your case I'm thinking you _don't_ want to use this line of code.

the way to test which end is having the problem is to

a) try the server from different machines - including putting the server online so we can get to it from here and let you know what happens and

b) try from different browsers on your machine. Firefox respects content-disposition as well, so you should see the same behaviour in all browsers if the problem is in the server side.

cheers
Bruce

peterH

  • Sr. Member
  • ****
  • Posts: 413
    • View Profile
Re: Ping Bruce
« Reply #4 on: March 15, 2011, 02:17:36 AM »
Hi Bruce,

It's working now the way I want it!

Your last post got me pointed in the right direction. It was the content-disposition header line that forced the prompt to popup. I simply assumed - from studying the File Download Example - that this line was needed for telling the browser which file to serve. I now realize I was wrong <g>.

Thanks a lot for your help.
Peter