Hi.
This post says that in order to get data from a file polling port pub.flow:getTransportInfo must be called in the processing service.
After doing that originalFilename is supposed to be the file which is in work folder.
I tried to save/copy the file using pub.flow:savePipelineToFile. However nothing appears in the pipeline folder and the original file goes into the error folder. I also tried with filename.
Are there some additional steps to be able work with files received from pub.flow:getTransportInfo? Currently I’m using empty txt files.
File polling port calls the processing service invidually per file, right?
Hi Jesper,
as far as I can tell file polling port is supposed to invoke the processing service for each file received in th inbound folder.
But the filename being retrieved by getTransportInfo should not be the same as the filename for savePipelineToFile.
With the filename from getTransportInfo you should call pub.file:getFile to retrieve its content when it is not already present in the pipeline.
Can you provide some more details about your use case?
If you just want to save the file somewhere else, you should use pub.file-services.
Remember to edit fileAccessControl.cnf in WmPuiblic/config folder and reload WmPublic package afterwards when using pub.file-services.
Check IS Built-In-Services Reference for further informations.
Regards,
Holger
I intend to get pdf files using Windows file share SMB from another pc. The pdf is then sent as JSON to a REST API.
Is file polling even needed? I just realized it removes the original files and I don’t wan’t that to happen.
Pub.file:getFile gets only one file though. With pub.file:listFiles I’m able to get a list of files, but get a error when using getFile in a LOOP.
Pics
-
This is working
-
Error when getFile from listFiles
-
Folder, no access errors
![file_polling_tutorial_folder.PNG](https://global.discourse-cdn.com/techcommunity/original/2X/4/48f94c997a25b4d8b530f6b788e08e672d2b831f.png)
After some trial and error I managed to create a service (using both listFiles and file polling port), which copies files only if they don’t exist yet in the target folder. I had to use pub.string:concat to create proper folder paths.
That’s the original issue worked out but any advice regarding which method to use would be appreciated.
The service is going to be like this:
Non-local Windows SMB → Copy files → Local Windows
The pics in the earlier post don’t show up in the order i added them :P.
Hi Jesper,
The SMB could either be accessed by using a network path (\host\path_to_smb) or you can map it to a drive character and access it like any other drive in Windows.
There might be better solutions to copy files between two hosts then implementing this in webMethods itself.
You might want to check if ActiveTransfer can be used here or if this can be handled outside of webMethods.
Regards,
Holger