FTP from Uniface

Author: lammersma@hotmail.com (lammersma)

Hi there, We need to do some FTP from Uniface. In the existing code we do something like: - build a file with ftp-command's - start ftp in a dosbox with the as a paramater - interpret the result to see if there are any errors Not really rocketscience. Most of the times it works, but sometimes we miss some errors.... So it's not 100%. Before we start coding it all over, without the dosbox solution, I want to try and search for a existing solution. Is the anyone out there who has a FTP solution written in Uniface? I but this in the Uniface9 section, but I guess that a well build Uniface7 of Uniface8 solution can be migrated easy. So, these are welcome too! kind regards, Peter

8 Comments

  1. Hi Peter, FTP stuff out of UNIFACE is a nice idea ... by now i didn't try that :) So my reply will be more theoretical. How do you start the Transfer?! Do you call "FTP target" or (while i assume windows as a host) do you use the script mode param (-s:filename)? Is there a possibility to reroute the outputs? (like "ftp -s:myfile xyz.co.uk > udialog.log") greetz -GHAN-


    Author: -GHAN- (hansen@ahp-gmbh.de)
  2. HI -GHAN- :) We did it about 10 years ago like this: v_ftp = "ftp -i -s:%%v_ftp_commands%%% 123.45.6.789" activate "OSCOMMAND"."COMMANDOUT"(v_ftp, v_ftp_log) scan v_ftp_log, "Transfer complete" if ($result > 0) ............ It works, but it is not very fancy. The implementation is not the most important, but there must be better solutions (win api?). What I really should like is a component to perform the ftp tasks. WIth operations like 'createRemoteDir', 'getRemoteFilenames', etc. I hoped there would be a standard solution within Uniface, but there is not. I found a posting from Disco: http://lists.umanitoba.ca/pipermail/uniface-l/2005-August/001144.html Kind regards, Peter


    Author: lammersma (lammersma@hotmail.com)
  3. hmmm ... i can't see anything that would slip out of the LOG with this method. Perhaps you should expand the SCAN to some more reliable like the FTP returncode (which i actually don't have in mind right now). "Transfer complete" could come on any occasion :) ... But back to the main question on this! IS there such a component anywhere?! ... Guess not! I read the link you posted but the only thing they did was to freak out the IE a bit by telling it to transfer a FORM per FILEUPLOAD-bla bla! Not very reliable i guess, but well :) So ... what CAN we do!? ... hmmm ... since we want it to be transfered (i assume via web), we need to handle this to something else. I guess there is no need to do some 3GL on that since you will have a Webserver running on which you will fire out the ftp, right?! ... so ... erhmm. .. why not let a PERL script handle it for you!? PERL will do on any platform. Not the straight way, but surely a fast one! Let me paint it for you (WHO does WHAT): [UNIFACE] - calls a systemfile (lets call it "do_it_by_ftp_and_do_it_now.pl") - all files to be transfered will be held in a separed text-file which easily could be accessed by the PERL interpreter - after the job is done, WE expect to get an "OK" from the PERL thing. [do_it_by_ftp_and_do_it_now.pl] - looks for a file containing the things to be transfered - handles all the FTP stuff and acts as a full ftp client - after the job is done says : "OK" if its ok, "FAILED" if something went wrong [YOU] - sit back an smile, while this will do :) Are you in to PERL, Peter?! ... here's a little tutorial: -[Script starts here]---8<----------------- #!perl use Net::FTP; $ftp = Net::FTP->new("my.host.com"); # the Host to connect to die "FAILED $!" unless $ftp; $ftp->login("username", "password"); # authentification, if needed :) $ftp->cwd("/pub"); # cwd: changeworkdir aka CD $ftp->put("dummy.html"); # send "dummy.html" ;) $ftp->quit; print "OK"; -[Script ends here]-8<----------------- ... guess this is a true quick-and-dirty-solution, hmm ? :) hope, you like it and maybe it helped you a bit to solve you ftp-task ... greetz -GHAN-


    Author: -GHAN- (hansen@ahp-gmbh.de)
  4. Hello Peter, this is one example of the process I called dITo (do IT ourself): - make the community aware of the "use case" = start "the" document - discuss it in the community = update "the" document :iteration_start - collect the requirements of the community + establish some test scenarios = update "the" document - define/enhance a rock-solid API = update "the" document - develop solution-options within the community = update "the" document - have some first implementations (from different people) - provide a demo-application and test utilities = update "the" document - get the feedback of the community (the test it as well) = update "the" document goto iteration_start Success, Uli


    Author: ulrich-merkel (ulrichmerkel@web.de)
  5. ... erhmm this seems quite a nice idea, but this ist OFF-TOPIC here, isn't it? Moderator needed!


    Author: -GHAN- (hansen@ahp-gmbh.de)
  6. Hi G?nther, I do not see why a "lets sit together and DO it for all of us" is OFF-TOPIC in uniface.info. Peter has asked me about some example for a dITo-Project and this is a very good one. Here is Community Land and "dITo" is all about community.


    Author: ulrich-merkel (ulrichmerkel@web.de)
  7. The point is not that your TASK is offtopic in GENEREL ... no, it isn't. But the place in this forum is the wrong (for my taste). Here in this thread its all about this question of Peter. So why mix it up with some new stuff!? I would have made a NEW topic somewhere, but not in this thread. :)


    Author: -GHAN- (hansen@ahp-gmbh.de)
  8. Thanks G?nther for your explanation, I agree my posting does not directly contribute to the FTP-question. but the (implied) question for peter is if he thinks this topic could become our very first dITo-Project. I discussed the dITo-stuff with Peter before and think it is a good candidate to start working together. So whoever is interested to work in a worldwide development team: just drop a line. Happy New Year, Hope we can enjoy more contributions from other members of the community here, Uli P.S. On your latest post on $hitlist: It is a lousy feeling if you post something and get no feedback at all.


    Author: ulrich-merkel (ulrichmerkel@web.de)