Jump to content


Photo

Visual Basic Upload


  • Please log in to reply
No replies to this topic

#1 uainfantry

uainfantry

    Young Padawan

  • Members
  • Pip
  • 2 posts

Posted 12 April 2006 - 04:09 PM

I am making a program that will get information from a program and extract that info and save it into a .txt file. I have that part somewhat done.

The problem I have is I need to upload the .txt file to my website. I have this script but I get a Variable not defined error:

Option Explicit
'Upload or download files to FTP sites u
'	 sing only 5 lines of code!
'Thanks for the example Venari, it's gre
'	 at to get 'shown up' sometimes! >:-D


Private Sub cmdUpload_Click()


	With Inet1
		.Protocol = icFTP
		.UserName = "RealUsername" 'FTP servers require a valid logonid and password
		.Password = "RealPassword" 'before they Let you upload.
		.RemoteHost = "ftp.mysite.com"
		.Execute , "SEND C:\windows\desktop\atest.txt html\atest.txt"
	End With
End Sub


Private Sub cmdDownload_Click()


	With Inet1
		.Protocol = icFTP
		.UserName = "Anonymous" 'FTP servers often allows anonymous
		.Password = "[email protected]" 'downloading, no actual name necessary here.
		.RemoteHost = "ftp.mysite.com"
		.Execute , "GET html\atest.txt C:\windows\desktop\atest2.txt"
	End With
End Sub
Code taken from: http://pscode.com/vb...=14481&lngWId=1
After I get that figured out I have another question. The data that is being collected will sometimes repeat.

Data will look like this:

Name=
Number=

I want when the name repeats the number to add to the previous value gathered and not to overwrite. I was thinking if to us Visual Basic to do this function or to use PHP to stick these values into a Database and than add the numbers together. Whichever way would be easier I would like to go for it but I do not have a clue on how to go about this, so if someone could help I would appreciate it.

Thank you for reading.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users