Forum Discussion

nihil_limbadiya's avatar
nihil_limbadiya
New Contributor II
6 years ago
Solved

Error In File Operations Snap

HI,

I was reading earlier post ppl are having issue with File Operation Snap.

I am having same issue. I am trying to copy/Move file to one location to another.

I have used File POLLER snap to find the file. and using FIle Operation snap but its giving me an error. enough the folder is empty it says file is already there.

Can some one please help me.?

THanks

  • psung's avatar
    psung
    6 years ago

    In that case, the input binary data has zero byte. You need to select the boolean property “Write empty file” in the File Writer Snap.

26 Replies

  • dmiller's avatar
    dmiller
    Former Employee

    Which protocol are you using? (FTP, SFTP, S3…)

    If you are only moving one file, does the Target path specify down to the file name or just the new directory?

    • nihil_limbadiya's avatar
      nihil_limbadiya
      New Contributor II

      Hi,
      With the file poller snap I m getting files from Our server (3 files)and using SFTP I need to transfer them files to another server and move the send files on our server to send folder
      I tried using file operations it’s giving error

    • nihil_limbadiya's avatar
      nihil_limbadiya
      New Contributor II

      Hi.
      I am trying 2 things

      1. one Via SFTP
      2. Moving file within our Server :- please find attached error

      Also image of the snap of file operations

      • psung's avatar
        psung
        Employee

        Please have a look at the Snap reference document for File Operation Snap.
        Snap Behavior for Key Operations > FTP, SFTP and File Protocols > Copy Operation > S. No. 6

        S. No. 6 is a case when Source is a regular file, Target is an empty directory and ‘Error if exists’ is true.
        As shown in the table, the expected result is an error “Target already exists.”

        You may have expected to copy the source file into the directory specified in the Target property, but the Snap does not work that way. You should build an expression which produces a full path for the target file, e.g. _Destination_Path + $Path.substring($Path.lastIndexOf(“/”) + 1)

  • dmiller's avatar
    dmiller
    Former Employee

    I’ve forwarded this on to Dev as I’m a bit perplexed by this.

  • nihil_limbadiya's avatar
    nihil_limbadiya
    New Contributor II

    HI

    Thanks for the help i will try with these snaps. will let you know if any issues.

    Thanks

  • No, Directory Browser is not reading the file, only the metadata about the file including the path. You can also tell because the circular output (meaning it outputs JSON) of the Directory Browser snap does not connect to the diamond input of the File Writer, which requires binary input. You need the File Reader.

    • nihil_limbadiya's avatar
      nihil_limbadiya
      New Contributor II

      Hi Thanks,

      i have got access wieredly i am getting access denied messaged when i am trying to read file with file reader

      • RogerSramkoski's avatar
        RogerSramkoski
        Employee

        Make sure the file can be read by the account running the Snaplex service. If you need a deeper investigation into that situation please contact our Support team.