PowerShell - FTP Upload Script No Longer Working
-
WinSCP doesn't like [email protected] syntax for the username either. WTF
-
What version of Windows does this run on?
When i try to run it (Windows 10), it crashes on the $uri line.
-
@dafyre said in PowerShell - FTP Upload Script No Longer Working:
What version of Windows does this run on?
When i try to run it (Windows 10), it crashes on the $uri line.
Server 2012 R2 (is where the FTP client/script is running)
-
@wrx7m said in PowerShell - FTP Upload Script No Longer Working:
WinSCP doesn't like [email protected] syntax for the username either. WTF
because it is smarter and has credential variables to be supplied.
-
@JaredBusch So it looks like I will have to use url-encoding. However, I can't get this to work either.
https://winscp.net/eng/docs/session_url -
@wrx7m Why don't you just use the (built-in) ftp client in windows?
ftp -s:filename_with_ftp_commands
Run whatever commands you need for instance:
open 10.43.0.0 [email protected] user_password put D:\Data\BAUPC.CSV /BAUPC.CSV bye
Do it manually first so you know it works then just put the commands in the file.
PS. Here is a list of the command in the built-in windows ftp client. https://www.nsftools.com/tips/MSFTP.htm
-
@Pete-S I used to have that setup, but there was something that happened where it got deprecated or something like that. can't remember now. It was a couple of years ago. I will try it again.
-
@Pete-S it still gives login incorrect
-
@wrx7m said in PowerShell - FTP Upload Script No Longer Working:
@Pete-S it still gives login incorrect
Then you probably made a mistake somewhere.
Login works here with a username in the format [email protected]. Win7 client connecting to linux ftp server.
So it's not the windows ftp client that is the problem. -
It could be that the server is requiring a SSL/TLS connection.
Then it would connect over normal FTP but switch to encryption before sending username/password. But then all firewall rules and whatnot have to be set right and the client also has to support TLS for it to work.
Is it a windows server you sending the file to? Then check what ftp server settings it has.
-
I tried using this on a local FTP server that I control using known usernames and passwords....
using user.name / MySecretPassword! works fine.
using [email protected] / MySecretPassword! does not work at all -- with the ftp command line, nor the .Net.Webclient for me.
-
@Pete-S said in PowerShell - FTP Upload Script No Longer Working:
@wrx7m said in PowerShell - FTP Upload Script No Longer Working:
@Pete-S it still gives login incorrect
Then you probably made a mistake somewhere.
Login works here with a username in the format [email protected]. Win7 client connecting to linux ftp server.
So it's not the windows ftp client that is the problem.The server is running ProFTPD. It is not running encryption, because I had to disable encryption in Filezilla in order to connect.
-
This server is managed by our web development consultants, so I told them what I had tried and that I was now out of ideas on how to connect. Suggested maybe they can revert to the old syntax, sans @domain.com for the user name.
-
@wrx7m said in PowerShell - FTP Upload Script No Longer Working:
This server is managed by our web development consultants, so I told them what I had tried and that I was now out of ideas on how to connect. Suggested maybe they can revert to the old syntax, sans @domain.com for the user name.
It doesn't just affect ProFTPd... It also affects the FileZilla server as well.
-
@dafyre said in PowerShell - FTP Upload Script No Longer Working:
@wrx7m said in PowerShell - FTP Upload Script No Longer Working:
This server is managed by our web development consultants, so I told them what I had tried and that I was now out of ideas on how to connect. Suggested maybe they can revert to the old syntax, sans @domain.com for the user name.
It doesn't just affect ProFTPd... It also affects the FileZilla server as well.
Thanks for testing that out for me. I appreciate knowing that I am not crazy.
-
I assumed this was somehow related to how auth basic allows you to formulate your login as :
user:[email protected]
Therefore, the @ sign is being misinterpreted when it's being provided in a username.With that in mind I went searching the interwebs and came across THIS confirming my suspicions.
Can you try replacing your @ sign with the + sign and let us know if it works? i.e.
wrx7m+gmail.com
-
Where I tried and it works fine was Win7pro built-in ftp client to Pure-FTPd server.
The [email protected] type names are VERY common on cpanel installations. I think it's referred to as long-form username.
So basically it's used by millions. -
@Pete-S Yeah, I am not saying it isn't common. I find it very strange too.
-
@manxam said in PowerShell - FTP Upload Script No Longer Working:
I assumed this was somehow related to how auth basic allows you to formulate your login as :
user:[email protected]
Therefore, the @ sign is being misinterpreted when it's being provided in a username.With that in mind I went searching the interwebs and came across THIS confirming my suspicions.
Can you try replacing your @ sign with the + sign and let us know if it works? i.e.
wrx7m+gmail.com
Thanks for the suggestion. However, this doesn't work either. I also tried %40 (instead of @), which is what winscp comes up with in its generator.
-
@wrx7m : Darn. Sorry