Webpage login -> download file lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- Haraldsen · 2014-03-25 18:28 How to download a file from a web page with Lazarus? The file cant be accessed until we are logged in: Code: [Select]

Your Username/Email:

Your Password:

Here's the link to file: http://www.somesite.com/repository.php?file=data&no=000001 Have started looking at Synapse for this, but no success so far. Maybe you have other suggestions for this task?  Fpweb? ---------------------------------------------------------------------- BeniBela · 2014-03-26 10:35 You can use my internet tools for login (do I have to post this every time?? use the forum search): Code: [Select]uses simpleinternet; httpRequest(process('http://www.somesite.com/repository.php?file=data& no=000001', 'form(//form, {"email": "your login", "password": "your password"})')); httpRequest('http://www.somesite.com/repository.php?file=data&no=00000 1') ---------------------------------------------------------------------- BigChimp · 2014-03-26 10:43 @BeniBela: yes, you have to post this every single time because people are too lazy to read documentation, search forum or wiki, properly describe their problems etc. There are some exceptions and I'm glad of them. @Haraldsen: Using synapse: http://article.gmane.org/gmane.comp.lang.delphi.synapse.public/4185 ---------------------------------------------------------------------- Haraldsen · 2014-03-28 18:21 @BeniBela: Downloading worked immediately with your tools! Thank you! Without the example of syntax you wrote to me, it would have been impossible. The result of a httpRequest is always a string. Can it download a binary file? (Couldn't find anything about that in the docs). You seem to have produced a quality piece of software. Documentation with examples of use and examples of syntax could make it more popular. ---------------------------------------------------------------------- BeniBela · 2014-03-28 22:25 Quote from: Haraldsen on March 28, 2014, 07:21:49 pm The result of a httpRequest is always a string. Can it download a binary file? (Couldn't find anything about that in the docs). Yes. The string is just a sequence of chars/bytes (string is easier to use than a TStream, since it is ref-counted) (perhaps I have to change the return type for fpc 2.8 ) Quote from: Haraldsen on March 28, 2014, 07:21:49 pmYou seem to have produced a quality piece of software. Documentation with examples of use and examples of syntax could make it more popular. There is already a lot of pasdoc generated documentation on my webpage about it. (Most of) The syntax is now standard XQuery + JSONiq there are examples on the internet (e.g. wikipedia)