VFPConnection Delete File

Posted on 2013-10-01
Medium Priority
Last Modified: 2013-10-03
Just wondering if anyone here is familiar with vfpconnection.fll and if so can you tell me how I would go about Deleting a File on a remote server?

I've tried
Local Array aryFTPCommands(1)
aryFTPCommands(1) = "DELE " + lcImage
lcString = 'FTPCommands("FTP://' + lcUser + ':' + lcPass + '@' + lcDomain + '", @aryFTPCommands, "MyTrace()")'

Open in new window

and other variations without any luck.
Other functions work fine - uploading, downloading - I just can't get Delete to work.
Question by:formadmirer
LVL 12

Assisted Solution

jrbbldr earned 750 total points
ID: 39537773
I'll begin by admitting that I have never used  VFPConnection.fll, but I do execute FTP operations via VFP applications.

I have successfully used modified code originally obtained from the   FTP Client @  http://www.davesummers.net/foxprolinks.htm

It does include an FTP-Delete

And, since all of the source code is there, you might want to look it over.

Good Luck
LVL 30

Accepted Solution

Olaf Doschke earned 750 total points
ID: 39539931
The FTP command to delete a file is DELE, correct, but I also read cases where it's rather del. Also unlike VFPs DELETE FILE you can only specify files in the current working directory, AFAIK, so instead of DELE /your/tables/some.dbf you CWD /, CWD your, CWD tables, and finally DELE some.dbf, first move from the FTP root directory to the destination directory, then delete only specifiying the filename. FTP commands are very atomic.

And DELE may also fail on insufficient rights.

Bye, Olaf.

PS: What if you use an FTP client and manually connect and delete a file? Refering the RFC 959 definition of FTP commands, a DELE may cause a safety question "Do you really wish to delete?", even in case you send over commands programmatically. That of course stops the process before files are deleted.

Author Closing Comment

ID: 39543433
Thanks for the help.

I wound up finding two different options for FTP in VFP, but after hours of getting nowhere with either of them my son created a batch file utilizing DOS FTP to delete the file.

Featured Post

Train for your Pen Testing Engineer Certification

Enroll today in this bundle of courses to gain experience in the logistics of pen testing, Linux fundamentals, vulnerability assessments, detecting live systems, and more! This series, valued at $3,000, is free for Premium members, Team Accounts, and Qualified Experts.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

The System Center Operations Manager 2012, known as SCOM, is a part of the Microsoft system center product that provides the user with infrastructure monitoring and application performance monitoring. SCOM monitors:   Windows or UNIX/LinuxNetwo…
User Beware!  This is a rather permanent solution to removing your email from an exchange server.  The only way to truly go back is to have your exchange administrator restore your mailbox from backups.  This is usually the option of last resort.  A…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

597 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question