Post a reply

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: Sadly no

So please post some logs.

Your attempt with >2024-03-04 is definitely wrong.
TPyne

Sadly no

Sadly no. It still tries to transfer the file which makes no sense.

I tried making it go after a certain date because the new files are not locked but then it gave some message about merging files together,
get Generate*.bt    -delete   >2024-03-04

This tried to merge all the files together. It also did not delete them.

To work around it I wrote get statements for each of the valid file prefixes. We will just handle the others manually on request. It's a pain but after that last one I can't risk losing files on our system because the program decided to merge them together.
martin

Re: Can it work with -delete

@TPyne: What about this?
get * -delete -filemask=*.bt|PCID*
TPyne

Can it work with -delete

I process several files with WinSCP however somehow a few a locked on the other server which belongs to another company. So they do not delete when I use the command
get *.bt -delete

This means not only does it not process past the locked file it keeps downloading it over and over.

I tried get *.bt -delete |PCID* and even -delete |PCID*.bt but then it says it cannot get the file information.

Any ideas.

I've reached out to the other company to manually delete the file but they can take days. I've used WinSCP and several other FTP clients to delete this file and get a 550 error.

The irony is the file was generated by the other company. We would normally download it and process it but since it is locked somehow we cannot. It would just process the same file over and over.

This script has been running for a few years now and until today no issues.

Is there a way I can ignore a specific filename but still have the -delete switch. We have to delete the files we pull down.
Jovy

How to transfer multiple file types

Hi,

I've succeeded to transfer one file type but how do I code it in script and batch file? For instance I need to transfer both csv and txt file? How should I append it.
Andres

Thanks Martin, now I get it.

If anyone is interested, This make the trick to filter by file type and exclude sub folders:
*.jpg |  */


For instance:
transferOptions.FileMask = jsonConfig.files_mask + " | */";
martin

Re: Directory Transfer: Multiple file mask

I'm not sure I understand the question.

If you want more masks, just separate them with a semicolon, like *.jpg;*.png;*.gif | */
https://winscp.net/eng/docs/file_mask#combining
Andres

Directory Transfer: Multiple file mask

Hi guys. Thanks for this awesome library :) it's helping a lot.

I'm working with VS2015 C# and I have following code.

// Upload files
TransferOptions transferOptions = new TransferOptions();
transferOptions.TransferMode = tmde;
// that will contain "*.jpg;|*/";
transferOptions.FileMask = jsonConfig.files_mask;
 
SynchronizationResult syncResult =
    session.SynchronizeDirectories(
        SynchronizationMode.Remote,
        jsonConfig.local_path,
        jsonConfig.remote_path,
        false,
        false,
        SynchronizationCriteria.None,
        transferOptions);

But sadly it works only with the last or only one file mask.
Is there any way to add more than one?

Thanks in advance.