Forum Discussion

FalleurJ's avatar
FalleurJ
New Contributor
7 years ago

Need help w/ File Poller to File Operation

Hi, I am trying to use a file poller to look through an ftp directory and find a file, and then using the file operation snap to then send the file to correct directory,

In the file poller i have the correct directory to point to and the file name with a wildcard (‘*’) and the file type.
i.e filename * .txt

Then in the file operation, I have the source: $path
and target location: directory/path/$path

I am getting this error—>

EDIT: I see what I am doing wrong, the path is the whole url of the file, How can I pull just the file from the $path, because the timestamp is always going to be different and post it in the target directory.

2 Replies

  • Have you tried an expression like

    $path.split("/").pop()
    

    This will split the path on slashes and then remove the last one off the end of the array, which should be the file name.

  • nihil_limbadiya's avatar
    nihil_limbadiya
    New Contributor II

    Hi,

    Have you found the solution? if yes, then can you please share it ? thanks