Florin V
Florin V

Reputation: 344

Can not delete zip file from ftp server.Only zip files

I'm using FtpWebRequest, and I can delete files & folders, upload, create, etc. but I cannot delete .zip files.

I have a recursive function that deletes all files and folders. When it hits a .zip file, the request throws an unknown exception with "System error" error message.

I have wasted half of the day with this issue. Does anyone has any idea why this is happening?

Upvotes: 1

Views: 450

Answers (2)

Florin V
Florin V

Reputation: 344

The path length was the main issue here. Using FtpWebRequest, you dont use command like CWD or PWD, the class resolves the commands for you. After i`ve shortened my paths, i can delete anything i want. The strange thing is that i could create those long named folders, and upload files in them without any kind of issue. The problem was revealed only when i tried to delete them.

Upvotes: 1

Andrew Cooper
Andrew Cooper

Reputation: 32576

It's possible that the FTP server is treating the .zip file like a directory and allowing you to traverse into it, but does not support deleting files from the .zip.

Upvotes: 0

Related Questions