Uploading an HTML File to a website

D

Dave Hawks

I use the following code to upload an html file to a website triggered at
regular intervals by the on timer property of a form.
This works OK until for any reason the website cannot be reached when I get
a runtime error which halts the routine until the error message is cleared
manualy.
Is there any way of automatically accepting the message and simply closing
the form so that it will try again on the next timer event.
Private Sub Form_Timer()

Dim objFTP As InetTransferLib.ftp
Const conTARGET = "ftp://ftp.*******"
Set objFTP = New InetTransferLib.ftp
With objFTP
.FtpURL = conTARGET
.SourceFile = "C:/WebsiteUploads/repToday.html"
.DestinationFile = "/*******"
.AutoCreateRemoteDir = True
If Not .IsConnected Then .DialDefaultNumber
.ConnectToFTPHost "userid", "passwd"
.UploadFileToFTPServer
End With
ExitHere:
On Error Resume Next
Set objFTP = Nothing
Call SysCmd(acSysCmdRemoveMeter)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top