Quantcast
Channel: PowerShell.org » All Posts
Viewing all articles
Browse latest Browse all 13067

Reply To: Problem ftp files in a fold with space in it's name.

$
0
0

PowerShell does not include a native ability to talk to an FTP server. There might be something FTP-related in the underlying .NET Framework you could use (I’m not sure).

In the past I’ve done this by scripting the native Windows FTP command-line client. You could launch that from within PowerShell, but do so just as easily from Cmd.exe or Task Scheduler. It’s not a PowerShell-specific feature.

I believe “/n software” still offers an add-in for PowerShell that includes FTP functionality (I think it’s still called PowerCmdlets).

That said, scripting the native FTP client can make it difficult to deal with failures and other problems. Most of my customers who need to do what you’re doing eventually look into a Managed File Transfer (MFT) solution (Ipswitch is one company that makes them).

Actually, just did a quick search and found http://msdn.microsoft.com/en-us/library/system.net.webrequestmethods.ftp.aspx, which is what you may have been trying. That’s the WebRequest object, which seems to be able to speak FTP. If it isn’t taking your URL, and doing URL-style encoding isn’t working, then it might just not like the remote server (spaces in filenames or folder names technically isn’t allowed in the FTP protocol). But the WebRequest object isn’t PowerShell per-se; if that’s what you’re using and nobody else chimes in here, you might consider asking on StackOverflow.com. That’s more oriented to .NET development (amongst other languages) and you’re more likely to find someone who has done what you’re trying to do.


Viewing all articles
Browse latest Browse all 13067

Trending Articles