SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jan 2005
    Location
    .
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Form to text file or FTP command

    Hello,

    I need to upload a file from a known location on a server to a static FTP address. Now I was using Windows built in FPT client which is easy and I can create a text file which contains the FTP commands i.e open 10.10.10.10 put file1

    for example, The problem is the name of the file to be uploaded changes and the ftp script is simply a DOS text file. I need to therefore ask the user for the name to the file to upload and then using this together with the FTP command (as all other infomation stays the same) to upload the file. I was thinking about creating a simple web page asking them to put the name of the file into the form hot go. It would be good if the JavaScript could then take the input from the from as the file name and then FTP this (from the source directory which always stays the same) to the destination which also always stays the same.

    Any ideas Please?
    Thank you

  2. #2
    SitePoint Zealot romance's Avatar
    Join Date
    Apr 2004
    Location
    UK
    Posts
    181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's not really possible to upload and manipulate files using javascript. If your looking for something similar, try php or asp. www.hotscripts.com has a lot of scripts like this.

  3. #3
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, the simplest one would be an ordinary bat file:

    Code:
    upload.bat:
    
    echo open 10.10.01 > ftp.cmd
    echo put %1 >> ftp.cmd
    etc
    ftp < ftp.cmd
    del ftp.cmd
    user then just calls upload myfile.doc from command line. If you need "GUI" for this, the same can be also done with windows scripting host.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •