FTP Command fails some of the time

This topic contains 1 reply, has 2 voices, and was last updated by Profile photo of Don Jones Don Jones 2 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #48090
    Profile photo of RAGHAV JHA

    $ftpparmfile =
    $command = 'ftp -v -i -s:$ftpparmfile '
    Invoke-Expression "& $command"

    These lines are used in a powershell script used in a scheduled daily tasks where files are transferred to a banking organisation.
    Most of the time the FTP process is successful, but some of the time it is neither able to FTP any file nor gives any error.

    What i think the problem is that the command timeout is early for ftp and need to increase the time for it it tries to transfer the file.
    I have tried some timeout logic but none of them is working, Please suggest me some ways for to cope up with this!!

    Profile photo of Don Jones
    Don Jones

    Well, because http://Ftp.exe is an external command (not a PowerShell cmdlet), you're not really looking at a PowerShell problem, or a PowerShell solution. I'm not sure http://Ftp.exe provides a means of increasing the server timeout. All i can think of is either (a) fixing the server so that it responds promptly or (b) getting a better FTP client.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.