4 Replies Latest reply on Jun 4, 2007 10:22 AM by bregent

    help w/ refreshing a daily pdf upload

    jwillproctor
      I set up a small rural company w/ the capability to upload daily a community news brief to thier website, which I maintain. The upload format is a pdf file. I cannot upload it each day so I set up an ftp program and have a daily upload scheduled. All the company has to do is resave thier new document and the ftp "puts" the file automatically. The problem is the PDF is uploaded but I (others) cannot view the new file because it is not refreshing the file each day. Is there any way to force the pdf file to refresh automatically. The only way I can view the daily update is to clear my cache. We are testing this now but if it cannot be "fixed" then the small company will be force to continue sending this out via email.

      Thanks!
      Justin
        • 1. Re: help w/ refreshing a daily pdf upload
          Level 7
          For web pages, you can use meta tags to specify no-cache or expiration
          (though that doesn't always work). Try these links:
          http://www.mnot.net/cache_docs/
          http://www.i18nguy.com/markup/metatags.html
          http://www.htmlgoodies.com/beyond/reference/article.php/3472881


          Not sure how to apply that to a PDF though.


          --
          Alec Fehl, MCSE, A+, ACE, ACI
          Adobe Community Expert

          AUTHOR:
          Microsoft Office 2007 PowerPoint: Comprehensive Course (Labyrinth
          Publications)
          Welcome to Web Design and HTML (Labyrinth Publications)

          CO-AUTHOR:
          Microsoft Office 2007: Essentials (Labyrinth Publications)
          Computer Concepts and Vista (Labyrinth Publications)
          Mike Meyers' A+ Guide to Managing and Troubleshooting PCs (McGraw-Hill)
          Internet Systems and Applications (EMC Paradigm)
          • 2. Re: help w/ refreshing a daily pdf upload
            bregent Most Valuable Participant
            Maybe you can use a script (client or server side) to append a parameter to the url. This should cause the browser to think it is a new file and download it rather than use the cached version. Use the current time/date in the parameter.
            • 3. Re: help w/ refreshing a daily pdf upload
              jwillproctor Level 1
              Do you have an example...albeit I am relatively proficient in DW...I am not a coder. Maybe you could point me to an example of something similar?

              Thank you
              • 4. Re: help w/ refreshing a daily pdf upload
                bregent Most Valuable Participant
                >Do you have an example...albeit I am relatively proficient in DW...I am not a coder.

                I would probably do it on the server side, but I don't know if you are setup for that. Here's an example of client side javascript that uses DW open window behavior modified to add a unique random id to the url. If you want the document to open in the same window, you could probably use the gotoURL function instead. Hope it works for you.

                <html>
                <head>
                <title>Untitled Document</title>
                <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
                <script language="JavaScript" type="text/JavaScript">
                <!--
                function sMM_goToURL() { //v3.0
                var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
                for (i=0; i<(args.length-1); i+=2) eval(args +".location='"+args[i+1]+"'");
                }

                function MM_openBrWindow(theURL,winName,features) { //v2.0
                theURL = theURL + "?id=" + Math.floor(Math.random()*1000000 )
                window.open(theURL,winName,features);
                }
                //-->
                </script>
                </head>

                <body>
                <a href="/Docs/my.pdf" onClick="MM_openBrWindow('/Docs/my.pdf','','');return false">test</a>
                </body>
                </html>