download with wildcards search is not working

0 votes
asked Sep 20 by Vinay (220 points)

Hi Support,
I am trying to download file with specific string in its name from sftp using below code but it doesn't download nor throw any error.

in my example, I need to download the file having "MapleBrownPrice" .

string SearchPattern = "MapleBrownPrice??.CSV";
sftp.Download(sourcepath + SearchPattern, @destinationPath );

Please suggest.

Thanks
Vinay

Applies to: Rebex SFTP
commented Sep 20 by Vinay (220 points)
its working now, I had to change the search pattern to "MapleBrownPrice*.CSV"

Thanks

1 Answer

+1 vote
answered Sep 20 by Lukas Pokorny (104,290 points)

Hi, the "MapleBrownPrice??.CSV" will only match files with exactly two characters between "MapleBrownPrice" and ".CSV". On the other hand, "MapleBrownPrice*.CSV" will match files with any numbers of characters there.

For more information, see Using wildcards.

...