Change remote directory


rexp

Recommended Posts

Hi

Can you please advise the correct way to change a remote ftp directory.

I have been trying with the script below but get errors

Thanks

Rex

FTP.strRemoteFile = "cd /Solar"

FTP.Upload()

FTP.strLocalFile = "c:\page_0.jpg"

FTP.strRemoteFile = "page_0.jpg"

FTP.Upload()

Link to comment
Share on other sites

Woops - I posted the wrong script (before I had it right)

while(1)

delay(60) // wait 60 seconds

// capture Page_0 to a jpeg file

page.Capture("Main","c:\Main.jpg")

page.Capture("Solar_System_12v_2","c:\Solar_System_12v_2.jpg")

// setup file for upload:

FTP.strLocalFile = "c:\Main.jpg"

FTP.strRemoteFile = "/Solar/Main.jpg"

FTP.Upload()

FTP.strLocalFile = "c:\Solar_System_12v_2.jpg"

FTP.strRemoteFile = "/Solar/Solar_System_12v_2.jpg"

// do the upload:

FTP.Upload()

endwhile

This is what I am using but when viewing the remote server (with WinSCP) the files were not showing up in the Solar directory.

I logged in using DOS commands and ls'd the Solar directory and the files were there but WinSCP was not showing them there.

I don't understand why it didn't work yesterday but all seems to be working now.

Link to comment
Share on other sites

OK, so is it working or not? The first code definitely won't work. You can't do dos / Linux formatted commands like "cd /solar" using FTP. There are different commands for that, none of which DAQFactory support because they are unnecessary. You should be able to upload to a folder in your FTP directory by passing the full path into strRemoteFile as you did in the second post. I can't say why it didn't work before as you likely have made lots of changes.

Link to comment
Share on other sites

Hi

It is working fine - the problem appeared to be a refresh problem in the Win FTP software I was using, when I looked at the /Solar directory there was nothing there but when logged in under a dos command prompt the data was there. It took a reboot of the computer and the WinSCP software to be able to get it to correctly the remote directory.

Thanks

Rex

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.