Closed FeroKli closed 2 years ago
Enable Set-FTPTracing -Enable
and run it again, and let me know what it says.
Sorry, I had an error in -RemotePath switch. NOw it is working perfectly. Thank you very much :-) Fero
Once again... If I use switch -RemotePath "/Temporary/$($File.Name)" in cycle, status is FALSE, but when I use Sent-FTPFile at once, with -RemotePath "/Temporary" switch, it is working fine. I tried cmdlet Set-FTPTracing -Enable as you wrote, but result is always false.
Is there please any reason , why to send files in cycle, not sent them at once? Thank you Fero
This is to have more control over the errors per file. I tried sending them at once and the output was only true/false from the method so I decided to loop it myself. Probably could add another option to force at once - but then you miss the output if errors occur
Thank you, I do understand. But in loop with -RemotePath "/Temporary/$($File.Name)" it will not send any file, all results are FALSE. (see in attachement) Have you tried it in version 0.0.14? It is working for you? Thanks Fero
Yes, if you have multiple files, you are not supposed to push a path with the file name. How do you expect the command to know which name to use? If you push just a folder name where to put file it will use that instead.
If you want to control the file name for each and every file yourself - you need to loop it yourself.
OK, I think, I do understand. Sorry I am not that good at programming. I just used code from your examples: https://github.com/EvotecIT/Transferetto/blob/master/Examples/Example06-UploadFTPS.ps1
Yes, if I use just "/TEMP" in -RemotePath switch, it is working well. Thank you wery much. Fero
That seems weird that you get a message 0. The commands in a loop give Message differently
THe command Send-FTPFile outside of the loop gives message 0,1,2,3 depending on how many files it was able to copy.
Looking at your output
This looks like it's trying to send 4 files to a single file and hence it's not working. If it's indeed that command giving you a problem I would check what does File.Name contains because it could be that ListFiles is not working properly.
Yes, it is weird. I used $File.Name in loop and it contain name of the file by file (fero.txt, fero2.txt...) I checked version of powershel, It is 5.1. - integrated in windows. And $ListFiles ->
Dear Przemyslaw, I am really sorry, but I had a mistake in my code. I used $ListFiles.FullName instead of $File.FullName in -LocalPath switch... I do apologize. Tank you very much. Fero
Dear Przemyslaw, thank you for publishing version 0.0.14. Error with not existing function Remove-EmptyValue disappeard, but after trying to send four files using function Send-FTPFile, result of the transfer is FALSE. But there is no other error message, just FALSE after sending each file. I tried to use cmdlet Test-FTPFile, the result for 4 files is False,True,True,False,False (little bit strange five answers for 4 files). Please, have you any Idea, why transfer fail and how to solve it? Thank you. Fero