Date:  09/02/2017 10:50:08 PM Msg ID:  004896
From:  Art Bergquist Thread:  004894
Subject:  Re: Poll until file exists on server
I then implemented a hidden field whose value is the name of the .PDF file but when I query that field with either of the following lines:
I get null back both times. 
Sent by Art Bergquist on 09/02/2017 09:25:06 PM:
I've got a web page in which I programmatically create an .html file in a certain folder/directory on the server.

My client has ActivePDF's DocConverter running on the server; DocConverter watches that folder/directory so that anytime an .html file gets created there, DocConverter automatically generates a .PDF file from the .html file.
The issue is that when the web page displays with a hyperlink to the .PDF file, the .PDF file has not always been generated yet (in fact, most of the time, the .PDF is not immediately available).
I'm looking to implement JavaScript in the window.onload event to poll the server to see when the file exists.  I've got a function to see if a file exists.  What I'm currently researching is how to pass the name of the .PDF file from the VFP code in the .FWx to the JavaScript in the window.onload event (in the same .FWx).
I implemented the following line immediately after initializing the memory variable for the name of the generated .PDF file:
  Session.SetVar('generatedPdfFileName', m.lcWebFile)
but when the following code gets called from the window.onload event:
it throws an "Uncaught ReferenceError: session is not defined" error.
Any thoughts? 
Art Bergquist