10-07-2021 07:43 PM
I am experimenting with LabVIEW 2021 32-bit and the new SFTP VIs.
I am trying to upload files to an SFTP server.
I can successfully connect to the server, create a directory, download files, and list directory contents.
But I am struggling to upload a file. I did manage to do it yesterday - somehow - just the once! I don't quite know what I did, but it's not working now. I get Error -5580893, which says "The SFTP operation failed on the server for an unspecified reason. This is the standard error for many SFTP commands."
I looked at the examples - there is only one SFTP example, and it is to demonstrate List Directory. This example is a bit light on, and it would be nice if there were more complex examples, and at the very least an example of a file being uploaded which I thought would be the main use case!
I was able to download a file successfully - but it is unclear from the description as to whether local path should be simply a folder or a file. Turns out you need to give it a filename. This sort of thing would be easier to work out with better examples.
Has anyone tried these VIs, and successfully and repeatably uploaded files to an SFTP server? I am wondering if I need to play around with the File attributes a bit, but once again - no examples to provide some clues.
I am using WinSCP to confirm what's happening on the SFTP server.
Attached is a snippet of my code.SFTP Trial code
Solved! Go to Solution.
10-08-2021 12:53 AM
@Ozfarmboy wrote:
I am experimenting with LabVIEW 2021 32-bit and the new SFTP VIs.
I am trying to upload files to an SFTP server.
I can successfully connect to the server, create a directory, download files, and list directory contents.
But I am struggling to upload a file. I did manage to do it yesterday - somehow - just the once! I don't quite know what I did, but it's not working now. I get Error -5580893, which says "The SFTP operation failed on the server for an unspecified reason. This is the standard error for many SFTP commands."
I looked at the examples - there is only one SFTP example, and it is to demonstrate List Directory. This example is a bit light on, and it would be nice if there were more complex examples, and at the very least an example of a file being uploaded which I thought would be the main use case!
I was able to download a file successfully - but it is unclear from the description as to whether local path should be simply a folder or a file. Turns out you need to give it a filename. This sort of thing would be easier to work out with better examples.
Has anyone tried these VIs, and successfully and repeatably uploaded files to an SFTP server? I am wondering if I need to play around with the File attributes a bit, but once again - no examples to provide some clues.
I am using WinSCP to confirm what's happening on the SFTP server.
Attached is a snippet of my code.
SFTP Trial code
That's odd... wonder why you would need to supply a filename?
10-12-2021 01:00 AM - edited 10-12-2021 01:04 AM
I managed to resolve this issue.
The reason it would not upload the file is that the remote path needs to be a file path (not just a folder path). So when I explicitly stated the filename in the remote path, it successfully uploaded. I was then able to download it successfully too.
Other things I noticed:
Updated snippet attached.
06-08-2023 01:51 AM
Hello,
I am trying to dowload COMTRADE files from a METSEPM8240 using SFTP protocol with Labview. The connection works without any error but then when I try to download files it gives an error. This error occurs if I use a file in the local and the remote path. Despite the error, the program deletes the file of the local path but doesn't dowload the file from the remote one.
I have tried with other functions as upload or make a list but all SFTP functions give me the same error. If I use WinSCP to download the file it works perfectly too. Does anyone have any clues? Maybe there is a problem with the path? I will appreciate your help, thanks in advance.
Here I attach the code.
06-08-2023 04:50 AM - edited 06-08-2023 04:53 AM
Could you try my snippet of code above and see how that goes?
The error is below - something not right with the connection?
06-08-2023 06:31 AM
I have tried a copy of your code but it still without working. It can open the connection but then the same error appears.
Maybe there is a problem with the permisions of the host? Or I have to go to lower level? I have tried different path and different functions but anyone works. Thanks.
I attached the code used.
06-09-2023 02:10 AM
Can you confirm your User/Host/Port fields etc are all ok.
Can you try with a different SFTP server to test and see if it's something strange about your current SFTP server?
06-09-2023 04:05 AM
Yes, I use WinSCP and it works good, I can dowload all the files. So the user, password, host and port are okay. I want to remark that the open connection with labview works, but then it breaks when I try other functions.
Thaks for your replies Ozfarmboy
06-12-2023 03:48 AM
If I go to low level, replacing with subVI contents the SFTP VIs that have errors I finally arrive to a sintactic error that says neither nor bundle nor bundle is allowed on this vi. As it is possible to see in this image.
To solve this problem I have found that I have to add the VI to the class, but I don't know wich VI should I add in my case. It is possible that the problems to use the SFTP VIs steam from this error? How can I solve this issue?
Thank you