I am using Rebex 2005 to get and put files to a server. When I am done I need to Delete the files I deleted from the directory where the files resided "target_folder"

How can I delete the files? There is a DeleteFile(string remotePath) method in Rebex, but I don't know how to use it? What value needs to be specified for "remotePath"

Am I suppose to specify an actual physical hard drive for the file location? Like this: string fileName="Example.txt" client.DeleteFile("C:\remote_path" + fileName); // client is my Rebex object.

What confuses me is the rebex function prototype is as follows: void Ftp.DeleteFile(string remotePath)

it says remotePath, however it does not indicate that a filename needs to be specified?

asked 22 Jul '10, 01:47

eirelav's gravatar image

eirelav
16
accept rate: 0%


The remotePath argument of the DeleteFile method is a path to a file.

You are not supposed to specify an actual physical hard drive for the location - most FTP server present a virtual Unix-liek filesystem that uses slash ('/') as directory delimiter and the whole structure starts at "/". Check out the tutorial for more information.

To delete "Example.txt", use the same path you used to upload it using PutFile or download it using GetFile:

client.PutFile(@"c:\local_path\" + fileName, "/remote_path/" + fileName);
...
client.DeleteFile("/remote_path/" + fileName);
link

answered 22 Jul '10, 11:44

Lukas%20Pokorny's gravatar image

Lukas Pokorny ♦♦
2.2k18
accept rate: 32%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×136
×5
×5

Asked: 22 Jul '10, 01:47

Seen: 649 times

Last updated: 31 Mar '11, 22:23