How to to post a zipped file to the server

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • garydene
    New Member
    • May 2010
    • 3

    How to to post a zipped file to the server

    I am new to javascript and I am battling to get the syntax right to post a zip file to the server.
    when the user clicks the button it must send a zipfile called send2serv.zip
    to the server.
    It must use application/x-zip-compressed
    it must pass the username admin
    and the password ****
    and the file name send2serv.zip

    I've done this in delphi successfully but the client needs me to use javascript.
    If javascript cannot do this then is their an activex object I can get hold of to pass the parameters to that can be used in Javascript.
    Last edited by Dormilich; May 27 '10, 10:18 PM. Reason: do not give away your passwords
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    it depends where send2serv.zip is located. the only way to send a file on the local file system is using <input type="file">, where (afaik) you cannot set the value by JavaScript.

    Comment

    • garydene
      New Member
      • May 2010
      • 3

      #3
      Thank you for the input type="file"
      I need to pass the filename, username and password to get the file uploaded.
      The names are an example only they are not real.
      The server would have an address for example http://10.0.etc
      The file send2serv.zip is on the C: drive in a folder called Backup
      The username alpha
      The password ****
      How do I pass this in Javascript to get the file uploaded
      Last edited by Dormilich; May 28 '10, 09:37 AM. Reason: removed password

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        you can always call an URI including login/password:

        http://login:password@restricted.example.org

        Comment

        • garydene
          New Member
          • May 2010
          • 3

          #5
          the url is similar to http://10.0.1.....:808 0/TeachFile/zip?overwriiteo verwrite=no" so it will not work

          Comment

          • Dormilich
            Recognized Expert Expert
            • Aug 2008
            • 8694

            #6
            it doesn’t matter, if the domain is named or numbered…
            http://login:password@127.0.0.1:8080...teoverwrite=no

            Comment

            Working...