Menu

ftpGetFileAction

Adam Tauno Williams

OIE

ftpGetFileAction

Retrieves a file from an FTP service. See [ftpPutFileAction] for uploading a file to an FTP service.

Parameters

Parameter Description
username The username to provide to the FTP server for authentication. If no username is provided anonymous authentication will be attempted.
password The password to provide to the FTP server for authentication. If not specified it defaults to the e-mail address of the process' owner. Password will always be NULL if no username is provided.
server The network hostname of the FTP server.
filename The filename to retrieve from the FTP server.
passive Defaults to YES, a value of NO disables passive mode leaving the connection in Active mode.
directory Directory to change to on the FTP server after authentication. If not specified no CHDIR is performed.
mimetype MIME-type to use for message containing the retrieved file; if not specified defaults to "application/octet-stream".

Example

Connect and authenticate to the FTP server "ftp.example.com" and retrieve the file "tvh.zip" as the work-flow message labeled "RetrievedData" having a MIME type of "application/zip".

<action name="actionActivity" id="000010"
        extensionAttributes="V200RetrieveCrossFile/000010">
  <input property="RetrievedData" formatter="StandardRaw"/>
  <attributes xmlns="">
    <extension name="activityName">ftpGetFileAction</extension>
    <extension name="server">ftp.example.com</extension>
    <extension name="filename">tvh.zip</extension>
    <extension name="username">******</extension>
    <extension name="password">*******</extension>
    <extension name="mimetype">application/zip</extension>
  </attributes>
</action>

Possible Errors

File Does Not Exist

Traceback (most recent call last):
  File "/srv/projects/coils-code/coils/logic/workflow/services/process.py", line 592, in work
    action_name, description = self.run_stanza( action_uuid )
  File "/srv/projects/coils-code/coils/logic/workflow/services/process.py", line 281, in run_stanza
    parameters=stanza.get('params'))
  File "/srv/projects/coils-code/coils/core/context.py", line 530, in run_command
    command.run()
  File "/srv/projects/coils-code/coils/core/logic/action.py", line 283, in run
    self.do_action()
  File "/srv/projects/coils-code/coils/logic/workflow/actions/doc/ftpgetfile.py", line 72, in do_action
    callback=self._write_block_to_wfile,
  File "/usr/lib64/python2.7/ftplib.py", line 409, in retrbinary
    conn = self.transfercmd(cmd, rest)
  File "/usr/lib64/python2.7/ftplib.py", line 371, in transfercmd
    return self.ntransfercmd(cmd, rest)[0]
  File "/usr/lib64/python2.7/ftplib.py", line 334, in ntransfercmd
    resp = self.sendcmd(cmd)
  File "/usr/lib64/python2.7/ftplib.py", line 244, in sendcmd
    return self.getresp()
  File "/usr/lib64/python2.7/ftplib.py", line 219, in getresp
    raise error_perm, resp
error_perm: 550 File tvh.txt not found

Related

Wiki: OpenGroupwareIntegrationEngine

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.