OutputTo command to an FTP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Carl Witte
    New Member
    • Dec 2006
    • 37

    OutputTo command to an FTP

    Hello. I'm using Access '07 and I need to regulariliy put a PDF on a FTP site. Can I do this directly with the outputto command?
    Code:
    DoCmd.OutputTo acOutputForm, form_name, acFormatPDF, "ftp://files.myftpsite.com/" & lotnum & ".pdf", False
    I can't seem to make this work. Or do I need to use the OutputTo command to a local file upload separately. I can do the steps separately just fine but I always prefer to do in one command line what I could do in two.
    If anyone has gotten this to work in a simpler fashion I'd love to hear about it.
    Carl
  • Swarve
    New Member
    • Mar 2009
    • 2

    #2
    Hi Carl,

    I've used batch files to automate a process similar to yours:
    Code:
    @echo off
    REM Creates text file containing FTP commands
    echo open <SERVER_NAME> >cmdlist.txt	
    echo <USERNAME> >>cmdlist.txt
    echo <PASSWORD> >>cmdlist.txt
    Echo Put <PDF FILENAME> >>cmdlist.txt
    Echo BYE >> cmdlist.txt
    Echo Copying Files from server
    ftp -s:cmdlist.txt >>results.txt  REM Creates a log file of the commands sent and responses received
    del cmdlist.txt  REM removes the text file containing the commands
    Cheers,

    P

    Comment

    • Carl Witte
      New Member
      • Dec 2006
      • 37

      #3
      Out of curiosity do you find the log file to be of particular use? To date I only create and use a log file when I have an error indicating a failure. Carl

      Comment

      • Swarve
        New Member
        • Mar 2009
        • 2

        #4
        Hi Carl,

        The log file has come in useful a couple of times to track back to a certain date that the ftp batch file failed and ensure that the required files were transferred.

        Cheers,

        P

        Comment

        • Carl Witte
          New Member
          • Dec 2006
          • 37

          #5
          Thanks for your help.

          Comment

          • NeoPa
            Recognized Expert Moderator MVP
            • Oct 2006
            • 32634

            #6
            Elegant solution Swarve.

            Welcome to Bytes!

            Comment

            • NeoPa
              Recognized Expert Moderator MVP
              • Oct 2006
              • 32634

              #7
              For further reading on the matter and the concepts see http://bytes.com/topic/access/answer...p-transfer-vba

              Comment

              • Carl Witte
                New Member
                • Dec 2006
                • 37

                #8
                Thank NeoPa. Missed it when I was looking through my search of the archives.
                I'm using the wininet.dll with no problems for the transfer. My concern was after I have connected to the FTP site could outputto place the file there directly or did the file have to be written locally then transferred. It appears the answer is the file has to be written locally then transferred.

                Thanks again for your help.
                Carl

                Comment

                • NeoPa
                  Recognized Expert Moderator MVP
                  • Oct 2006
                  • 32634

                  #9
                  Ah. I hadn't appreciated that.

                  Good luck with your project anyway :)

                  Comment

                  • Carl Witte
                    New Member
                    • Dec 2006
                    • 37

                    #10
                    No problem. I probably wasn't clear in my original post. :-)
                    Carl

                    Comment

                    Working...