Upload is throwing up on me

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Bruce
    Indigo Rose Customer
    • Jun 2001
    • 2134

    Upload is throwing up on me

    FTP.Connect("72.107.232.39", "logon", "password", "", true);
    FTP.MakeDir(my_variable.."");
    err = Application.GetLastError();
    if err ~= FTP.OK then
    Dialog.Message("Error", _tblErrorMessages[err]);
    end WORKS GOOD

    FTP.Upload(_DesktopFolder.."\\folder1\\folder2\\". .another_result.."\\source.txt", "source.txt", nil);
    err = Application.GetLastError();
    if err ~= FTP.OK then
    Dialog.Message("Error", _tblErrorMessages[err]);
    end

    Will not upload... I get TRACE: LastError = 31023 ("An unknown error occurred.")

    Anything poking anyone in the eye?
  • AS1
    Forum Member
    • Jun 2009
    • 70

    #2
    First off all: FTP.MakeDir(my_variable..""); should be: FTP.MakeDir(my_variable);

    and for your problem

    if it is a linux server you should replace the \\ in the rmote path for // else i should check if you have full permisions to write/read

    Comment

    • Imagine Programming
      Indigo Rose Customer
      • Apr 2007
      • 4252

      #3
      Originally posted by AS1 View Post
      First off all: FTP.MakeDir(my_variable..""); should be: FTP.MakeDir(my_variable);

      and for your problem

      if it is a linux server you should replace the \\ in the rmote path for // else i should check if you have full permisions to write/read
      First of, you don't know wether my_variable is a number or not, using this he
      simply converts it to a string quickly :yes tostring(my_variable) would be nicer.

      Second off, all my servers are linux servers except for one, and paths use
      backslashes on it. the double \\ means you escape one of them, because the \
      character is used to escape characters in a string, to prevent escaping, escape
      the escape character: \\

      This has no logic: // if it would be a path using that character, one would suffice.
      Bas Groothedde
      Imagine Programming :: Blog

      AMS8 Plugins
      IMXLH Compiler

      Comment

      • Imagine Programming
        Indigo Rose Customer
        • Apr 2007
        • 4252

        #4
        Code:
        FTP.Upload(_DesktopFolder.."\\folder1\\folder2\\"[COLOR="Red"]. .[/COLOR]another_result.."\\source.txt", "source.txt", nil);
        The red marked dots should be clear of spaces, make sure you don't have
        spaces between them.

        Code:
        FTP.Upload(_DesktopFolder.."\\folder1\\folder2\\"[COLOR="Red"]..[/COLOR]another_result.."\\source.txt", "source.txt", nil);
        Bas Groothedde
        Imagine Programming :: Blog

        AMS8 Plugins
        IMXLH Compiler

        Comment

        • JimS
          Indigo Rose Customer
          • May 2003
          • 1057

          #5
          Don't you need to use the path to the destination in the upload?

          FTP.Upload(_DesktopFolder.."\\folder1\\folder2\\". .another_result.."\\source.txt", my_variable.."/source.txt", nil);

          Comment

          • Imagine Programming
            Indigo Rose Customer
            • Apr 2007
            • 4252

            #6
            Originally posted by JimS View Post
            Don't you need to use the path to the destination in the upload?

            FTP.Upload(_DesktopFolder.."\\folder1\\folder2\\". .another_result.."\\source.txt", my_variable.."/source.txt", nil);
            I thought that wasn't neccesary since you change the current directory, where
            you are currently working in.
            Bas Groothedde
            Imagine Programming :: Blog

            AMS8 Plugins
            IMXLH Compiler

            Comment

            • JimS
              Indigo Rose Customer
              • May 2003
              • 1057

              #7
              Originally posted by Imagine Programming View Post
              I thought that wasn't neccesary since you change the current directory, where
              you are currently working in.
              I just tested it, and both ways seem to work. Your way is easier :yes

              Comment

              • Imagine Programming
                Indigo Rose Customer
                • Apr 2007
                • 4252

                #8
                Originally posted by JimS View Post
                I just tested it, and both ways seem to work. Your way is easier :yes
                Yes it would be normal if it would work indeed :yes I used the FTP plugin
                alot for personal tools, for example a small application to simply add products
                to my website, because doing all that by hand would take too much time IMO.
                Bas Groothedde
                Imagine Programming :: Blog

                AMS8 Plugins
                IMXLH Compiler

                Comment

                • RizlaUK
                  Indigo Rose Customer
                  • May 2006
                  • 5552

                  #9
                  i found the FTP plugin to be somewhat qurikey on certain servers

                  maybe the server is not liking the upload command, try sending a custom command to upload the file ("put myfile.exe")
                  Embrace change in your life, you never know, it could all work out for the best

                  Comment

                  Working...
                  X