Was wondering if anybody managed to use the HTTPFetcher (saving the files) with multiple url's.
Any suggestions are welcome.
Itay
Was wondering if anybody managed to use the HTTPFetcher (saving the files) with multiple url's.
Any suggestions are welcome.
Itay
Both target URL and output filename can be specified as Attribute Value, so I would try to send multiple features having pair of URL and filename to the HTTPFeatcher as initiators.
Takashi
Yes, been busy :)
I actually didnt think about using the Target attribute but the file name (that cannot be set by an attribute or parameter), thanks for the redirection.
Itay
I do that, like Takashi said, by parsing the target url using attributes:
for example :
http://geodata.nationaalgeoregister.nl/ahn2/extract/ahn2_05m_ruw/@Value(Blad).tif.zip
This one is used to dinamically fetch rasters.
In this case i fetch the downloadpage.xml in a separate fetcher and extract the url, using the ahngridfile i build the url using another fetcher.
U could do @Value(url)@Value(Blad).@Value(extension) or something like it.
Was nice meeting you in person at the fmewt, thanks for the answer, I got it working as suggested by Takashi.
donwloadlocation from my previous post:
G:\\LDNKDG\\KDGGE\\CGI\\Projecten\\2014\\G14-051_Rhijnhofweg_hoogtemetingen_in_digitale_kaart\\Analyse\\@Value(Blad).tif.zip
Basically when no output filename is spcecified, the file downloaded will be located at the same location as the workspace is.
I wanted a small variation on that, basically downloading to a sub folder of the FME_MF_DIR parameter.
By adding $(FME_MF_DIR)\\Download\\@Value(Id) I basically got that, now that made me wonder if FME will create the sub folder if it does not exist, unfortunatly that is not possible by only using the HTTPFetcher.
But then I can live with that too,
Cheers,
Itay
-----
# PythonCaller script example
import fmeobjects, os
def createFolder(feature):
path = feature.getAttribute('_folderpath')
if not os.path.exists(path):
os.makedirs(path)
-----