Cross-platform Method to Download File lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- a_butta · 2010-09-07 10:49 Hi, I'm new on this forum, and i don't speack english very well, so i'm sorry for my language and i apologize to you if i mistook the location of the topic. I would ask you if there's a cross-platform method to download a file through a Http URL using lazarus (not to depend on the OS i'm using). Thank! ---------------------------------------------------------------------- theo · 2010-09-07 12:04 http://synapse.ararat.cz/doku.php See: http://synapse.ararat.cz/doc/help/httpsend.html Or http://lnet.wordpress.com/ ---------------------------------------------------------------------- a_butta · 2010-09-07 12:36 Thank very much! I installed LNet, but i didn't understand how to use it in according to my aim. Can you help me? Thank you! ---------------------------------------------------------------------- theo · 2010-09-07 12:49 I always use synapse, where you can simply use: function HttpGetText(const URL: string; const Response: TStrings): Boolean; For lNet there are examples in the zip file in lnet/examples/visual/http ---------------------------------------------------------------------- a_butta · 2010-09-07 13:56 Good! I've only a doubt: do Synapse work either on Win and Linux? Thanks! ---------------------------------------------------------------------- Silvio Clécio · 2010-09-07 14:34 Hi, A project using Synapse: http://code.google.com/p/lazsolutions E.g.: http://code.google.com/p/lazsolutions/source/browse/#svn/trunk/Demos/L SHTTPSend (Download, get picture, post in Twitter... etc). Thanks. ---------------------------------------------------------------------- Silvio Clécio · 2010-09-07 14:35 Oops, LazSolutions is cross-platform. ---------------------------------------------------------------------- theo · 2010-09-07 16:44 Quote from: a_butta on September 07, 2010, 03:56:31 pmI've only a doubt: do Synapse work either on Win and Linux? Yes. ---------------------------------------------------------------------- a_butta · 2010-09-07 21:49 Good! Thank very very much to both. I have another question and i don't know if i must open a new topic. If i must do, i apologize and do it. How i can delete a file from a folder using a cross-platform method? ---------------------------------------------------------------------- theo · 2010-09-07 22:46 http://www.freepascal.org/docs-html/rtl/sysutils/deletefile.html ---------------------------------------------------------------------- JD · 2010-09-08 09:03 Good work silvioprog. The more examples we can get on these things the better. ---------------------------------------------------------------------- a_butta · 2010-09-08 09:09 Good! thank you! About the preceding argoument, i downloaded the Synapse zip, but i didn't succeeding in installing the units in order to use them in all projects only adding a uses-clause, without having to put every time the units in projects directory. I hope i had been clear. Thank ---------------------------------------------------------------------- theo · 2010-09-08 09:42 Quote from: a_butta on September 08, 2010, 11:09:42 am i downloaded the Synapse zip, but i didn't succeeding in installing the units in order to use them in all projects only adding a uses-clause, without having to put every time the units in projects directory. There is a laz_synapse.lpk in trunk. http://synalist.svn.sourceforge.net/viewvc/synalist/trunk.tar.gz?view= tar ---------------------------------------------------------------------- a_butta · 2010-09-08 10:23 i installed it, but i can't use httpsend in uses clauses. It return the classic error "unit1.pas(8,80) Fatal: Can't find unit HttpSend used by Unit1" ---------------------------------------------------------------------- theo · 2010-09-08 10:37 Quote from: a_butta on September 08, 2010, 12:23:41 pmi installed it, but i can't use httpsend in uses clauses. It return the classic error "unit1.pas(8,80) Fatal: Can't find unit HttpSend used by Unit1" Please read the Wiki and FAQ http://wiki.lazarus.freepascal.org/Lazarus_Packages#FAQ ---------------------------------------------------------------------- a_butta · 2010-09-08 15:46 Nothing: i add a new package with all the unit conteined in the synapse zip. I press Compile and Install Key, lazarus return a success, and after restarting lazarus, the problem persists. I'm going mad! Sorry fo my inexperience ---------------------------------------------------------------------- Silvio Clécio · 2010-09-09 01:33 The package of Synapse need not be installed (is a RunTime package), just compile at least once. ---------------------------------------------------------------------- a_butta · 2010-09-09 11:39 I can't understand: i opened the package laz_synapse.lpk, i compiled it. Then i opened a new project and in uses-clauses i added HttpSend. It is found as file (in fact if i press CTRL+LeftMouseButton it opens httpsend unit) but when i build the project, it return the error Unit1.pas(8,80) Fatal: Can't find unit HttpSend used by Unit1 I can't understand HOW i have to compile this package ---------------------------------------------------------------------- theo · 2010-09-09 12:31 Did you read the FAQ? It seems not. http://wiki.lazarus.freepascal.org/Lazarus_Packages#FAQ Second Answer. ---------------------------------------------------------------------- Silvio Clécio · 2010-09-10 01:40 Hi a_butta, See the link of theo, is the exact solution. ---------------------------------------------------------------------- a_butta · 2010-09-10 10:57 Yeah! i succeeded in adding the lib to my project, but i have to repeat this operation for each project i open? ---------------------------------------------------------------------- xenblaise · 2010-10-23 14:20 @silvioprog? your pdf can't be downloaded; http://blog.silvioprog.com.br/2010/09/criando-uma-aplicacao-web-com- lazarus.html thanks