udotdevelopment/ATSPM

FTP path hard coded

Opened this issue · 1 comments

if(!ftpClient.DownloadFile(SignalFtpOptions.LocalDirectory + Signal.SignalID+ @"\" + localFileName, ".."+Signal.ControllerType.FTPDirectory +@"/" + ftpListItem.Name))

This line is prepending ".." to the path. That might be a vendor specific thing so it should be in the FTPDirectory column of ControllerTypes in the database, not hardcoded here. This breaks controllers that don't use a relative path in their configuration.

Fix is remove ".."+ from the line above and it in the database instead.

if(!ftpClient.DownloadFile(SignalFtpOptions.LocalDirectory + Signal.SignalID+ @"\" + localFileName, ".."+Signal.ControllerType.FTPDirectory +@"/" + ftpListItem.Name))

This line is prepending ".." to the path. That might be a vendor specific thing so it should be in the FTPDirectory column of ControllerTypes in the database, not hardcoded here. This breaks controllers that don't use a relative path in their configuration.

Fix is remove ".."+ from the line above and it in the database instead.

@ian-cameron , I'm pretty green when it comes to diagnosing and fixing issues on my end with this system, but I've come across an issue that may be related to your post. Where can I find the SignalFTP.cs file to edit that line of code and remove the ".."? Or is that even possible?

Or would it be a better idea to just create a new line in the ControllerType table and address it there by how I insert the FTPDirectory for that new item?

Would I need to add a subfolder so it backs up one to the correct folder, or again, is that not even possible?