Results 1 to 4 of 4

Thread: Delete a file locally after sending to ftp

  1. #1
    Join Date
    Aug 2009
    Posts
    57

    Delete a file locally after sending to ftp

    I'd like to delete a file locally on my machine after having transmitted to a server via ftp? For now I do it in ftp command:

    The bat file that I run contains:
    Code:
    ftp -v -i -n -s:c:\windows\system32\foo\sndscript.txt
    del /s c:\windows\system32\foo\sndscript.txt
    then a file sndscript.txt in the same root contains:
    Code:
    open ftpme.foo.com
    user foo
    XXXXXXXX
    bin
    quote pasv
    put c:\foo.jpg
    ""It was there that I'd like to delete c:\foo.jpg?""
    bye
    File upload works very well also

  2. #2
    Join Date
    May 2008
    Posts
    991

    Re: Delete a file locally after sending to ftp

    I do not think that this command exists in FTP. FTP is not really a programming language, so I think that IF "ftp succeeded" then that would be better. So I think you should move that outside of the FTP, put it in the .bat file as well (with a little more logic)

  3. #3
    Join Date
    May 2008
    Posts
    551

    Re: Delete a file locally after sending to ftp

    Normally the command "DELE" should work.

    Command: DELETE (DELE)
    Description: This command causes the file specified in the pathname to be deleted at the server site. If an extra level of protection is desired (such as the query, "Do you really wish to delete?"), it should be provided by the user-FTP process.

  4. #4
    Join Date
    Nov 2008
    Posts
    1,066

    Re: Delete a file locally after sending to ftp

    Normally, using the ftp utility, adding an exclamation character "!" before the command makes them act locally.

    For example:

    dir (or ls): list the contents of remote directory
    !dir (or ls): list the contents of current directory.

Similar Threads

  1. Having issues with sending email using the file menu
    By atleastItry in forum Windows Software
    Replies: 1
    Last Post: 04-09-2010, 03:42 AM
  2. Problem while sending file via bluetooth in N73
    By MADGE25 in forum Portable Devices
    Replies: 5
    Last Post: 17-12-2009, 10:26 PM
  3. Problem in sending .exe file from yahoo IM
    By jhon in forum Technology & Internet
    Replies: 3
    Last Post: 04-05-2009, 06:33 PM
  4. Sending data to a file
    By puk284 in forum Software Development
    Replies: 0
    Last Post: 28-04-2009, 07:25 PM
  5. Sending an MP3 file with Thunderbird
    By Rock Villa in forum Technology & Internet
    Replies: 4
    Last Post: 17-04-2009, 07:35 PM

Tags for this Thread

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
  •  
Page generated in 1,751,727,101.77618 seconds with 16 queries