Hi
The easiest solution is to use three workspaces. One master workspace with just a Creator and two WorkspaceRunners chained one after the other.
The first workspace creates your output file and writes it to your local drive.
The second workspace uses the FTPCaller to upload it to your ftp server.
You can pass the filename between the workspaces as a published parameter.
David
By the way, this will get easier starting with the upcoming FME 2016 and the introduction of the FeatureWriter transformer.
David
ok, thanks. So much to the general workflow. But I don't manage to upload my files with the FTP-caller in the first place. Do I use the right settings (see above)?
(the upload works with FTP in a command-window)
I'm not sure about the Transfer Type: "Upload from a File": I don't want to upload
FROM a file, but just upload a file... ??
Hi
You should use "Upload from a file" when you have a file whose contents you want to upload to an ftp server.
Just make sure that you also specify the output filename in the URL parameter, not just the target folder.
Example:
ftp://ftp.myserver.ch/myfolder/myfilename.txt
David
To narrow things down, I tried to upload a testfile in a workbench with only the FTPCaller (no Reader / no Writer)
FTPServer: ftp.xy.ch
remote directory: abcd
File to upload: c:\\temp\\test.txt
>> URL (Transfer Parameters): ftp://ftp.xy.ch/abcs/test.txt
I also post part of the logfile. Obviously, FME doesn't do much at all...
INFORM|872007 Creating writer for format: NULL (Nothing)
INFORM|872004 Trying to find a DYNAMIC plugin for writer named `NULL'
INFORM|23016 Loaded module 'NULL' from file 'C:\\Program Files (x86)\\FME\\2015\\plugins/NULL.dll'
INFORM|23010 FME API version of module 'NULL' matches current internal version (3.7 20150407)
INFORM|871015 Creating reader for format: NULL (Nothing)
INFORM|871007 Trying to find a DYNAMIC plugin for reader named `NULL'
INFORM|23010 FME API version of module 'NULL' matches current internal version (3.7 20150407)
INFORM|23016 Loaded module 'LogCount_func' from file 'C:\\Program Files (x86)\\FME\\2015\\plugins/LogCount_func.dll'
INFORM|23010 FME API version of module 'LogCount_func' matches current internal version (3.7 20150407)
INFORM|872007 Creating writer for format: FME Feature Store (FFS)
INFORM|231006 FME Configuration: No destination coordinate system set
INFORM|23010 FME API version of module 'NULL' matches current internal version (3.7 20150407)
INFORM|23010 FME API version of module 'NULL' matches current internal version (3.7 20150407)
INFORM|231016 Emptying factory pipeline
STATS |370700 Destination Feature Type Routing Correlator(RoutingFactory): Tested 0 input feature(s), wrote 0 output feature(s): 0 matched merge filters, 0 were routed to output, 0 could not be routed.
STATS |50001 Final Output Nuker(TeeFactory): Cloned 0 input feature(s) into 0 output feature(s)
STATS |50021 f_2(CreationFactory): Created 1 features
STATS |50001 f_3(TeeFactory): Cloned 1 input feature(s) into 0 output feature(s)
INFORM|395206 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
INFORM|395204 Feature output statistics for `FFS' writer using keyword `W_1':
STATS | =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
STATS | Features Written
STATS | =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
STATS | ==============================================================================
STATS | Total Features Written 0
STATS | =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
STATS | =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
STATS | Features Read Summary
STATS | =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
STATS | ==============================================================================
STATS | Total Features Read 0
STATS | =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
STATS | =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
STATS | Features Written Summary
STATS | =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
STATS | ==============================================================================
STATS | Total Features Written 0
STATS | =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
INFORM|875106 Translation was SUCCESSFUL with 0 warning(s) (0 feature(s) output)
INFORM|246008 FME Session Duration: 0.7 seconds. (CPU: 0.2s user, 0.2s system)
INFORM| END - ProcessID: 9960, peak process memory usage: 54760 kB, current process memory usage: 54708 kB
I also added a reader to my testfile (txt_line) and connected the ftp_caller with it.
Then the FTPCaller was called during the translation and I could see an empty testfile on the FTP-Server at one point, but in the end it was not there anymore.
Again: part of the logfile
0.0|STATS |50001 Unexpected Input Remover Nuker(TeeFactory): Cloned 0 input feature(s) into 0 output feature(s)
0.0|STATS |50001 text_line Feature Counter -1 7(TeeFactory): Cloned 5 input feature(s) into 5 output feature(s)
0.0|STATS |50001 FTPCaller_OUTPUT Feature Counter -1 3(TeeFactory): Cloned 0 input feature(s) into 0 output feature(s)
0.0|STATS |50001 FTPCaller_<REJECTED> Feature Counter -1 5(TeeFactory): Cloned 5 input feature(s) into 5 output feature(s)
0.0|STATS |50021 FTPCaller__Rejected__DirCreator(CreationFactory): Created 1 features
0.0|STATS |50001 FTPCaller__Rejected__DirCreatorCleanerUpper(TeeFactory): Cloned 1 input feature(s) into 0 output feature(s)
0.0|STATS |51001 FTPCaller__Rejected__FeatureDirector(TestFactory): Tested 5 input feature(s) -- 0 feature(s) passed and 5 feature(s)
0.0|STATS |51001 FTPCaller__Rejected____FeatureDirector1(TestFactory): Tested 5 input feature(s) -- 0 feature(s) passed and 5 feature(
0.0|STATS |50001 FTPCaller__Rejected__VectorSetterUpper(TeeFactory): Cloned 5 input feature(s) into 5 output feature(s)
0.0|STATS |50001 FTPCaller__Rejected____PointCloudThinner(TeeFactory): Cloned 0 input feature(s) into 0 output feature(s)
0.0|STATS |50001 FTPCaller__Rejected__RasterSetterUpper(TeeFactory): Cloned 0 input feature(s) into 0 output feature(s)
0.0|INFORM|49051 FTPCaller__Rejected__Recorder(RecorderFactory): Recorded 5 feature(s) to file `E:\\FME\\temp\\test_105015\\inspector.ffs'
0.0|STATS |50021 FTPCaller_Output_DirCreator(CreationFactory): Created 1 features
0.0|STATS |50001 FTPCaller_Output_DirCreatorCleanerUpper(TeeFactory): Cloned 1 input feature(s) into 0 output feature(s)
0.0|STATS |51001 FTPCaller_Output_FeatureDirector(TestFactory): Tested 0 input feature(s) -- 0 feature(s) passed and 0 feature(s) fail
0.0|STATS |51001 FTPCaller_Output___FeatureDirector1(TestFactory): Tested 0 input feature(s) -- 0 feature(s) passed and 0 feature(s) f
0.0|STATS |50001 FTPCaller_Output_VectorSetterUpper(TeeFactory): Cloned 0 input feature(s) into 0 output feature(s)
0.0|STATS |50001 FTPCaller_Output___PointCloudThinner(TeeFactory): Cloned 0 input feature(s) into 0 output feature(s)
0.0|STATS |50001 FTPCaller_Output_RasterSetterUpper(TeeFactory): Cloned 0 input feature(s) into 0 output feature(s)
0.0|STATS |393374 Stored 5 feature(s) to FME feature store file `E:\\FME\\temp\\test_105015\\inspector.ffs'
0.0|INFORM|395305 Saving spatial index into file 'E:\\FME\\temp\\test_105015\\inspector.fsi'
0.0|INFORM|395306 Finished saving spatial index into file 'E:\\FME\\temp\\test_105015\\inspector.fsi'
0.0|STATS |393374 Stored 1 feature(s) to FME feature store file `E:\\FME\\temp\\test_105015\\inspector.fsc'
0.0|INFORM|49051 FTPCaller_Output_Recorder(RecorderFactory): Recorded 0 feature(s) to file `E:\\FME\\temp\\test_105015\\inspector.ffs'
0.0|STATS |370700 Destination Feature Type Routing Correlator(RoutingFactory): Tested 0 input feature(s), wrote 0 output feature(s): 0
0.0|STATS |50001 Final Output Nuker(TeeFactory): Cloned 0 input feature(s) into 0 output feature(s)
0.0|STATS |50021 f_24(CreationFactory): Created 1 features
0.0|STATS |50001 f_25(TeeFactory): Cloned 1 input feature(s) into 0 output feature(s)
0.0|INFORM|395206 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
0.0|INFORM|395204 Feature output statistics for `FFS' writer using keyword `W_1':
0.0|STATS | =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
0.0|STATS | Features Written
0.0|STATS | =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
0.0|STATS | ==============================================================================
0.0|STATS | Total Features Written 0
0.0|STATS | =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
0.0|STATS | =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
0.0|STATS | Features Read Summary
0.0|STATS | =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
0.0|STATS | text_line 5
0.0|STATS | ==============================================================================
0.0|STATS | Total Features Read 5
0.0|STATS | =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
0.0|STATS | =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
0.0|STATS | Features Written Summary
0.0|STATS | =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
0.0|STATS | ==============================================================================
0.0|STATS | Total Features Written 0
0.0|STATS | =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
0.0|INFORM|401803 Text File Reader: Closing the file 'C:\\temp\\test.txt'
Hi
You do not need a text line reader. Just use a Creator and send the dummy feature to the FTPCaller, which then uploads the specified file for you.
The text file to upload must of course exist before you run the workspace.
David
Also, consider connecting a Logger to the <Rejected> port of the FTPCaller, then look at the error messages. It seems your FPTCaller has rejected all your input features, for some reason.
David
>> see my second last post
Can you post a screenshot your workspace with a summary annotation on the FTPCaller?
For reference, I just tested the FTPCaller here using FME 2015.1.2 and it works perfectly.
Transfer Mode / Verify SSL Certificates >> FME Defaults
I tried it with ASCII / verify: No as well, with no success...
The FTPCaller needs a trigger feature on the input port, otherwise it does nothing.
Insert a Creator transformer and connect it to the FTPCaller input port.
With a Creator I can get the FTPCaller to work and upload a file.
(In my case this still doesn't work, but at least I found out why: The FTPCaller doesn't support passiveftp and to connect to the FTPServer where I wan't to upload my file, I have to use passiveftp. Now I'll write a batchfile instead of using the FTPCaller...).
Thanks for the feedback!
I wasn't aware about passive ftp not being supported, so that's great to have mentioned here for posterity.
David
Including the file name you are transferring in the FTPCaller's URL Transfer Parameter is very important, too. This was my problem, thankfully answered above by david_r, but not included in the Best Answer. Plagiarized below directly from david_r's own answer:
Just make sure that you also specify the output filename in the URL parameter, not just the target folder.
Example:
ftp://ftp.myserver.ch/myfolder/myfilename.txt