NetTalk Central

Author Topic: How to SSV fo Browser In Use?  (Read 5302 times)

johanco123

  • Full Member
  • ***
  • Posts: 245
    • View Profile
    • Email
How to SSV fo Browser In Use?
« on: March 05, 2015, 01:07:29 AM »
Hi Bruce

How can I set session Value(ssv)  with the name of the web browser that the client is using. eg Firefocks, Chrome  ?

Regards
Johan

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: How to SSV fo Browser In Use?
« Reply #1 on: March 05, 2015, 01:46:11 AM »
Hi Johan,

it's probably do'able, but I suspect unnecessary.
The
p_web.UserAgent
contains a string which should identify the browser to some extent.

Which I suppose begs the question -
What are you planning to do with the session value?

cheers
BRuce

johanco123

  • Full Member
  • ***
  • Posts: 245
    • View Profile
    • Email
Re: How to SSV fo Browser In Use?
« Reply #2 on: March 05, 2015, 04:29:34 AM »
Hi Bruce

Tanks for the feedback.

I have a form with a Media control on it. When I open the form it must load the pdf document. Read the path directly from the table. It is working fine in firefox. When i open the form in chrome it does not load the document in the media control but directly open the pdf in a new windows.

I try to setup an example but in the example it open in firefox and in chrome in the media control.

Any suggestions.

Regards
Johan

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: How to SSV fo Browser In Use?
« Reply #3 on: March 05, 2015, 06:38:20 AM »
>> I try to setup an example but in the example it open in firefox and in chrome in the media control.

what is different between your app and your example?

cheers
Bruce

johanco123

  • Full Member
  • ***
  • Posts: 245
    • View Profile
    • Email
Re: How to SSV fo Browser In Use?
« Reply #4 on: March 05, 2015, 09:09:50 PM »
Hi Bruce

The example is a memory form with the media control on it and  I set  the pdfFilename in InitForm - Start embed point to pdfFileName = '\reports\Newsletter 20150212.pdf'
URL set to pdfFileName  and autoplay to true.

In my app I have a browse  from a table. When click on the browse row, it opens a form with that record. In the media control the url set to blo:uploadpath from the record.. Autoplay is true
No embed code in the form

Regards
Johan

johanco123

  • Full Member
  • ***
  • Posts: 245
    • View Profile
    • Email
Re: How to SSV fo Browser In Use?
« Reply #5 on: March 05, 2015, 09:44:35 PM »
Hi Bruce

I create an example app giving the same results. Media control working fine in Firefox but chrome and Internet Explorer 11 does not show the pdf file in the media control but immediately open a new window with the pdf in.

Please find attached the example

Regards
Johan

[attachment deleted by admin]

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: How to SSV fo Browser In Use?
« Reply #6 on: March 06, 2015, 05:10:58 AM »
Hi Johan,

Earlier you said;

>> I try to setup an example but in the example it open in firefox and in chrome in the media control.

and now

>> I create an example app giving the same results. Media control working fine in Firefox but chrome and Internet Explorer 11 does not show the pdf file in the media control but immediately open a new window with the pdf in.

Can you tell me the difference between the first example and the second? That would probably help me diagnose the problem...

cheers
Bruce

johanco123

  • Full Member
  • ***
  • Posts: 245
    • View Profile
    • Email
Re: How to SSV fo Browser In Use?
« Reply #7 on: March 06, 2015, 05:17:22 AM »
The first example was only  a memory form with the media control on it and  I set  the pdfFilename in InitForm - Start embed point to pdfFileName = '\reports\Newsletter 20150212.pdf'

The example I send you is from a browse open a form from a table. That is where I was able to duplicate the problem

Using NetTalk8.35
Tanks
Johan

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: How to SSV fo Browser In Use?
« Reply #8 on: March 06, 2015, 05:23:45 AM »
Hi Johan,

ok, I understand what is happening. Actually it's somewhat surprising that FireFox shows it in the media control.

For security reasons files served from the /uploads folder always have their content-Disposition set to "attachment". Meaning that the browser should not display, or run, the file, but should instead treat it as a download.

This is because users can upload stuff to the server, and those files end up in /uploads.
So you should move the file out of uploads into something else (which is why it worked from the Reports folder) once you are sure the file is ok.

Cheers
Bruce

johanco123

  • Full Member
  • ***
  • Posts: 245
    • View Profile
    • Email
Re: How to SSV fo Browser In Use?
« Reply #9 on: March 06, 2015, 05:38:07 AM »
Tanks Bruce I will move it to an other folder