• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 185
  • Last Modified:

FTP a file???

I want a simple way to upload a file to a ftp server. It has to overwrite the file if it's already on the server. So i'm guessing it should be done with Winsock, instead of Inet, unless Inet can overwrite files.

Here's what i had but this doesn't overwrite files,

Inet1.AccessType = icUseDefault
Inet1.Protocol = icFTP
Inet1.RemoteHost = "server.com"
Inet1.RemotePort = "21"
Inet1.Password = "pass"
Inet1.UserName = "user"
Inet1.RequestTimeout = "60"

strLocal = file.Text

strRemote = "/usr/home/public_html/upload/" & upfilestr
Inet1.Execute , "PUT """ & strLocal & """ " & strRemote

Thanks.

0
jmingo
Asked:
jmingo
  • 2
1 Solution
 
EDDYKTCommented:
Inet1.Execute , "DELETE " & strRemote
0
 
jmingoAuthor Commented:
so always delete the file every time??

won't that cause an error if the file isn't there?? would i just put error handling to ignore it if the file isn't there??? if so do you know what the error number for that is??

thanks

0
 
EDDYKTCommented:
so always delete the file every time??

yes don't think you can get any error.
To be save do on error resume next
first
0
 
BurbbleCommented:
If I remember correctly, the Execute method just sends the data to the server. You have to interpret it yourself. So, if it returns an error caused by the "DELETE" being sent for a file that doesn't actually exist, and don't interpret the server's response as "bad", then there's no problem (If I remember correctly).
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now