Trying to delete a file via FTP

Bringing the internet highway into your project? Building FTP, HTTP, email, chat or other client solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
keithglong
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 348
Joined: Sun Jul 03, 2011 2:04 am

Trying to delete a file via FTP

Post by keithglong » Fri Jan 20, 2012 10:46 am

Hi All,

I am playing with FTP and am successfully able to upload a file to my shared server... No problem.

However, when I try the following command to delete the file after uploading, it does not work:

Code: Select all

put "file.txt" into delFile
constant FTPHOST = "ftp.mydomain.com"   
put the urlencode of "test@mydomain.com" into FTPUSER
put the urlencode of "test" into FTPPASS
get libURLftpCommand("DELE "&delFile,FTPHOST,FTPUSER,FTPPASS)
Also, when add the following line to my code:

Code: Select all

answer libURLftpCommand("HELP",ftp.mydomain.com)
I get the following error message:

421 Can't change directory to /var/ftp/ [/]

What am I missing here? Do I need to include the full path? FYI: The ftp account I am accessing is a basic account that I added via my cPanel... (It is a single directory on my server... This is not the main FTP account for my Web hosting account.)

Thanks!

- Boo

keithglong
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 348
Joined: Sun Jul 03, 2011 2:04 am

Re: Trying to delete a file via FTP

Post by keithglong » Fri Jan 20, 2012 11:21 am

Okay, strike that! Figured it out... The username and password should not be urlencoded:

Code: Select all

get libURLftpCommand("DELE "&delFile,"ftp.mydomain.com","test@mydomain.com","test")
Cheers!

- Boo

Post Reply