I'm working on a scenario wherein I need to move some files from one FTP location to another. The FTP server is the same but credentials for the source and destination are different.
For example,
I need to copy files
FROM
"ftp://sampleftp.com/sourceFolder" with login credentials "User1", "Password1"
TO
"ftp://sampleftp.com/destinationFolder" with login credentials "user2","password_2"
Kindly note the different credentials I have used above for source and destination.
I referred to this similar stackoverflow question link but that seems to work for the FTP folder with constant login credentials.
Can someone please guide me on how best can I implement this?
Thanks a lot!
Loading

Arul FPosted Feb 22, 2016, 9:38 AM
New-Object : Exception calling ".ctor" with "1" argument(s): "Invalid URI: The format of the URI could not be determi
d."
At line:3 char:22
+ $uri = New-Object <<<< System.Uri($ftp+$item.Name)
+ CategoryInfo : InvalidOperation: (:) [New-Object], MethodInvocationException
+ FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand
Exception calling "UploadFile" with "2" argument(s): "Value cannot be null.
Parameter name: address"
At line:4 char:26
+ $webclient.UploadFile <<<< ($uri, $item.FullName)
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
PS H:\>
Guest UserPosted Aug 3, 2014, 8:23 PM
http://www.codeproject.com/Articles/18229/How-to-run-PowerShell-scripts-from-C
the other one is to write your own code what Powershell scripts are doing? [I feel you're duplicating the existing capability by picking this option..]
Tell me which is your choice, and also why?
Amogh NatuPosted Aug 3, 2014, 11:44 AM
I apologize for not mentioning in the question. I want to implement this functionality using C# language.
Thanks,
Amogh.
Guest UserPosted Aug 3, 2014, 11:41 AM
#ftp server
Use, powershell again to upload: