Upload file without dialog?

Upload file without dialog?

1
NewbieNewbie
1

    Jun 07, 2006#1

    I'm very impressed with UE-32 so far, and am considering buying it, but there's one thing that's holding me back. I want to use UE to edit files and then quickly upload them. I can press F5, but then I have to press Enter. "Only" one extra key, but when you're editing hundreds of files a day, it adds up. Is there a way to set it up so that pressing F5 just immediately sends the file based on the directory you're in?

    2
    NewbieNewbie
    2

      Aug 19, 2006#2

      Guess not :( I want the same functionality... right clicking on the projects menu repeatedly is tiresome.

      344
      MasterMaster
      344

        Aug 21, 2006#3

        Maybe you get an idea from there ?
        You can run a "tool-call" to do the job:

        Macro to transfer files via FTP

        Should be an easy exercise to do a loop (afaik ftp needs single files, not directories) and use put instead of get...

        rds Bego
        Normally using all newest english version incl. each hotfix. Win 10 64 bit

        2
        NewbieNewbie
        2

          Aug 22, 2006#4

          Sorry, I'm not sure how to do it from looking at your other post...

          344
          MasterMaster
          344

            Aug 22, 2006#5

            OK,

            so here we go. I try to explain and offer a solution:

            Todo: copy all files of a local dir to a ftp-dir (both are known) with one klick.
            Solution: collect all filenames of that local dir with a vb-script file and generate an ftp-config-file.
            run that ftp command from script with this config file.

            Here is the vb-script "ftpDirectory.vbs":

            Code: Select all

            Option Explicit
            'ftpDirectory.VBS  
            'Copies all files in a local directory to a (known) ftp-dir
            'WARNING. NO GUARANTEE, USE AT OWN RISK. 
            'Bego
            
            Dim fso
            Dim shell
            Dim objOutputFile
            Dim fil
            Dim foCurrent
            Dim COMMANDDIR
            Dim MYLOCALDIR
            Dim MYHOST
            Dim MYUSER
            Dim MYPWD
            Dim MYREMOTEDIR
            
            COMMANDDIR = "c:\"                    'where the generated ftp file is stored
            
            'do your entries here !
            MYLOCALDIR  = "c:\temp\test"             'where your files that have to be ftp-ed are stored
            MYHOST      = "UNIXMACHINE1"
            MYUSER      = "herbert"
            MYPWD       = "dunno"
            MYREMOTEDIR = "/usr/herbert"
            
            Set fso = CreateObject("Scripting.FileSystemObject")    
            Rem Set foCurrent = fso.GetFolder(".\")
            Set foCurrent = fso.GetFolder(MYLOCALDIR)
            
            Set objOutputFile = fso.CreateTextFile(COMMANDDIR & "letsGo.ftp", TRUE)
            objOutputFile.WriteLine("open "& MYHOST)
            objOutputFile.WriteLine(MYUSER)
            objOutputFile.WriteLine(MYPWD)
            objOutputFile.WriteLine("ascii")
            objOutputFile.WriteLine("cd "  & MYREMOTEDIR)
            objOutputFile.WriteLine("lcd " & MYLOCALDIR)
            For Each fil in foCurrent.files
                objOutputFile.WriteLine("put " & fil.name)
            Next
            objOutputFile.WriteLine("bye")
            objOutputFile.Close
            
            Set shell = WScript.CreateObject("WScript.Shell")
            shell.Run "ftp -s:" & COMMANDDIR & "letsGo.ftp" , 1 , FALSE
            
            wscript.quit
            Here is an example of a GENERATED ftp-config file that is run by upper script:
            open UNIXMACHINE1
            herbert
            dunno
            ascii
            cd /usr/herbert
            lcd c:\temp\test
            put test.txt
            put test2.txt
            bye
            So: Just create a tool and call the ftpDirectory.vbs
            Before, change the "constants" like MYHOST etc. to your needs.

            Surely, it can be improved by using parameters !!!

            HIH. Bego

              Aug 23, 2006#6

              Hi,

              - here is the improved version with the curent directory as Parameter.
              (no need to use it, but it CAN be used)
              User-tool command looks like this: H:\dat\bat\ftpDirectory.vbs %P
              - Also, script asks before transfering :-)

              Any suggestions, comments are welcome

              rds Bego

              Code: Select all

              Option Explicit
              'ftpDirectory.VBS
              'Copies ALL files in a local directory to a (known) ftp-dir
              'If called with parameter %P, the CURRENT directory is chosen. No Parameter ? Define ource-directory in MYLOCALDIR by hand
              'WARNING. NO GUARANTEE, USE AT OWN RISK.
              'by: Bego
              '
              'USER-TOOL commandline might look like this:     H:\dat\bat\ftpDirectory.vbs %P
              '
              
              Dim fso
              Dim shell
              Dim objOutputFile
              Dim fil
              Dim foCurrent
              Dim FTPCONFIGFILE
              Dim COMMANDDIR
              Dim MYLOCALDIR
              Dim MYHOST
              Dim MYUSER
              Dim MYPWD
              Dim MYREMOTEDIR
              Dim cnt
              Dim answer
              Dim args
              
              COMMANDDIR    = "c:\"                    'where the generated ftp file is stored
              FTPCONFIGFILE = "letsGo.ftp"             'holds connection info and files to be transfered
              
              'do your entries here !
              MYHOST      = "UNIXMACHINE1"
              MYUSER      = "herbert"
              MYPWD       = "dunno"
              MYREMOTEDIR = "/usr/herbert"
              
              
              set args = WScript.Arguments
              If (args.Count = 0) Then
                  MYLOCALDIR  = "c:\temp\test"       'where your files that have to be ftp-ed are stored ONLY WHEN no parameter is given !!!
              Else
                  If (args.Count = 1)  Then
                      MYLOCALDIR = args.Item(0)
                  Else
                      MeldungRaus "ftpDirectory was called with wrong no. of parameters"
                  End If
              End If
              
              
              Set fso = CreateObject("Scripting.FileSystemObject")
              'Set foCurrent = fso.GetFolder(".\")
              Set foCurrent = fso.GetFolder(MYLOCALDIR)
              
              Set objOutputFile = fso.CreateTextFile(COMMANDDIR & FTPCONFIGFILE, TRUE)
              objOutputFile.WriteLine("open "& MYHOST)
              objOutputFile.WriteLine(MYUSER)
              objOutputFile.WriteLine(MYPWD)
              objOutputFile.WriteLine("ascii")
              objOutputFile.WriteLine("cd "  & MYREMOTEDIR)
              objOutputFile.WriteLine("lcd " & MYLOCALDIR)
              cnt = 0
              For Each fil in foCurrent.files
                  objOutputFile.WriteLine("put " & fil.name)
                  cnt = cnt + 1
              Next
              objOutputFile.WriteLine("bye")
              objOutputFile.Close
              
              Set shell = WScript.CreateObject("WScript.Shell")
              answer = MsgBox ("Are you sure you want to copy " & cnt & " files from " & vbcrlf & MYLOCALDIR & vbcrlf & " to " & vbcrlf & MYREMOTEDIR & " ?", vbyesno)
              If answer = VBYES Then
                  shell.run "ftp -s:" & COMMANDDIR & FTPCONFIGFILE,1 , FALSE
              End If
              
              wscript.quit
              
              Sub MeldungRaus (strMeld)
              
                  wscript.echo strMeld
                  wscript.quit 1
              
              End Sub
              
              Normally using all newest english version incl. each hotfix. Win 10 64 bit