Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Upload file via ftp.FilePut
#1
Hello there.
I have created a macro that allows me to retrieve information from a table every 30 seconds and then stores it into an Excel file.
The name of the file is just a paste from a string variable which is nothing more then the date and the time when the extraction of information occured, like this:

Code:
Copy      Help
DateTime x; x.FromComputerTime; xs=x.ToStrFormat("{yyyy}-{MM}-{dd} {HH}.{mm}.{ss}" 50) ; out xs ;

So it names the file and saves it to my computer. Then I want to upload it to an FTP drive, but the thing is, the name of the file is always different (every 30 seconds I create a new one). How can I make my code know which file to upload 30 seconds?

I thought something like this would work:

Code:
Copy      Help
Ftp f.Connect("xxx" "xxx" "xxx")
if(!f.FilePut("d:\userdata\p11silva\desktop\exports1\%s.csv" "%s" &xs, &xs)) OnScreenDisplay "FTP error: upload failed."
1
f.Disconnect
OnScreenDisplay "FTP Session Ended"

But I guess I'm thinking "C".
Can anybody help me?

Thanks a lot! Smile


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)