Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Qustion About script of WInscp

justinchenjy@... wrote:

and one more question, when i upload some big zip file.
some time this process will be broken and system will re-upload auto.
in re-upload process, will the destination SFTP server have a broken zip file or not?

WinSCP wouldn't resume the transfer, if the result would not be a valid file. Of course the disconnect is an indication of some problem. So you never can be 100% sure. But there's just a small probability of a problem.
justinchenjy@...

Re: Qustion About script of WInscp

martin wrote:

There's no such option.
You would have to code it.
E.g. using a PowerShell script using WinSCP .NET assembly.
It should be pretty easy.

You start with these examples:
https://winscp.net/eng/docs/script_upload_most_recent_file
https://winscp.net/eng/docs/script_upload_file_list

And you modify the first like:

$files =

    Get-ChildItem -Path $localPath |
    Sort-Object LastWriteTime -Ascending

foreach ($file in $files)
{
    Write-Host ("Uploading {0} ..." -f $file.Name)
    $session.PutFiles($session.EscapeFileMask($localPath + $file.Name), $remotePath).Check()
}


Not tested!


Hi Supporter,

Thanks!
and one more question, when i upload some big zip file.
some time this process will be broken and system will re-upload auto.
in re-upload process, will the destination SFTP server have a broken zip file or not?
martin

Re: Qustion About script of WInscp

There's no such option.
You would have to code it.
E.g. using a PowerShell script using WinSCP .NET assembly.
It should be pretty easy.

You start with these examples:
https://winscp.net/eng/docs/script_upload_most_recent_file
https://winscp.net/eng/docs/script_upload_file_list

And you modify the first like:

$files =

    Get-ChildItem -Path $localPath |
    Sort-Object LastWriteTime -Ascending

foreach ($file in $files)
{
    Write-Host ("Uploading {0} ..." -f $file.Name)
    $session.PutFiles($session.EscapeFileMask($localPath + $file.Name), $remotePath).Check()
}


Not tested!
justinchenjy@...

Re: Qustion About script of WInscp

martin wrote:

Files are uploaded in the order as they are presented by the operating system.

So generally the order is undefined, though the files are commonly sorted by a name.


Hi prikryl,


Thanks for reply.


if i want upload order by file create time, which option i can select?

BR

Justin
martin

Re: Qustion About script of WInscp

Files are uploaded in the order as they are presented by the operating system.

So generally the order is undefined, though the files are commonly sorted by a name.
justinchenjy@...

Qustion About script of WInscp

Dear Support,

i have a question.
i am using script to use winscp upload file to sftp server.
one of script is "option transfer binary"
i want to know, when i using this script, what is the order of the upload?
File name or frie created time?

hope your reply!

thanks

justin