• Error 6 (net::ERR_FILE_NOT_FOUND): The file or directory could not be found.

    By Fernando Levi 1 decade ago

    Hi Rami,

    I am getting an error when using the examples xpage. I downloaded, unzipped and signed the database on my server. After that, I ran the examples xpage on the web. The buttons "create pdf/file" and "create pdf/internal file resourse" work fine; but the others give  the following error: 

    This webpage is not found

    <span jstcache="4" jsvalues=".innerHTML:msg">No webpage was found for the web address:&nbsp;<strong class="failedUrl" jscontent="failedUrl" jstcache="16" style="word-wrap: break-word; "><a href="http://ardiles/test/pdfexporter/pdfexportcc.nsf/examples.xsp">http://ardiles/test/pdfexporter/pdfexportcc.nsf/examples.xsp</a></strong></span></div>
    
    Error 6 (net::ERR_FILE_NOT_FOUND): The file or directory could not be found.
    

    I have Domino 8.5.3 installed.

    Do you know what the problem could be?

    Thanks

    Fernando 

    • settings

      By Rami Muurimäki 1 decade ago

      Make sure you change the settings (Custom Properties) in every control in the example page. As default they point to localhost server. You may need to change some other settings aswell.

       

    • Error 6 (net::ERR_FILE_NOT_FOUND)

      By John Frusciante 1 decade ago

      Hi, Firstly can I say what an excellent project this is.  It's helped me enormously and Rami has done a first-rate job constructing and documenting this.

      I have used the examples and customised the local DB with no problem and had it working wonderfully.  However, when transplanting the code into a server-based DB, I'm always getting Error 6 (net::ERR_FILE_NOT_FOUND) when trying to use the output stream to a template in the File..Resource location.  I've double checked the path and I can even navigate from a browser to the PDF template by using the path directly in the address bar, so I can confirm access works.  What could this be?

      Are there any server based security setting that may be preventing access?  As I mentioned, if I use the same URL path (http://www.website.com/notes.nsf/template.pdf?OpenResource) directly in a browser, it opens.

      Thanks in advance!  John.

       

      • running on server

        By Rami Muurimäki 1 decade ago

        Hi,

        Thanks for kind words. I never imagined this controller would exceed 1000+ downloads.

        After you install the demo application to server, it won't work out of the box. After you've signed the application, you need also to modify the pdf custom controller's custom properties (behind each action button on the XPages). At the moment they are hard coded to point http://localhost address and obviously they cannot work on server environment.

        If this doesn't work, please let me know.

        • SSL

          By John Frusciante 1 decade ago

          Hi

          Thanks Rami.  I've checked that I've signed the DB and made the CC properties to the correct path (https://www.mywebsite.co.uk/website/pdfexportcc.nsf/template.pdf?OpenFileResource).  This link when used in the browser opens then PDF, so the link is good.  I'm wondering if the 'Requires SSL connection' setting on my DB is causing an issue?

          I've modified the two BL_pdfExport references of http: to also have https: equivalents,...

           

          if (tempFilename.startsWith(&quot;https://&quot;)) {
          
          return new PdfReader(new java.net.URL(pdfTemplateFile)); 
          
          }
          

           

          AND

           

           

          if (myPdfImage.imageName.startsWith(&quot;https://&quot;)) {
          
          imgName = new java.net.URL(myPdfImage.imageName);
          
          }
          

           

           

          Have you tried with an SSL required database at all?

           

          Thanks again!

           

          John

          • Design File Resource

            By Rami Muurimäki 1 decade ago

            As far as I remember, I haven't tested the controller with SSL (not sure since things comes and goes too quickly nowadays). So it can be (or is) an issue. Sorry about this.

            Have you tried to put the pdf template as a Design file resource (see the last example in exampes.xsp). Accessing the template files using ?OpenFileResource requires anonymoys access to the database and this can be a security hazard. I think this design file resource technique is better.

             

            At the moment there too many things and too short of hours in the clock me to do a new development spin with this controller. I have some new ideas to this controller which I liked to share here. We'll see how things goes ...

            • Thanks

              By John Frusciante 1 decade ago

              Hi Rami, thanks.  I've gone with your suggestion of the fileres: as it works fine.  As you say it's probably better practice too.

              I suspect the SSL/Anonymous combo is what foxes it.

               

              Thanks again for sharing your hard work.

              • great

                By Rami Muurimäki 1 decade ago

                Good news if it works and I was able to help. I'll see if I can find some time to stufy the SSL issue.