Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2007-06

CGI upload app

21 messages · 11 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Darius Blaszijk

Hi I would like to upload a file through a web page. How can I do this using FPC? Is there any example available?

Darius

Reply by email

Burkhard Carstens
to Michael Van Canneyt
Michael Van Canneyt wrote 5 lines
On Tue, 5 Jun 2007, Darius Blaszijk wrote: > Hi I would like to upload a file through a web page. How can I do > this using FPC? Is there any example available? The fpweb or cgiapp components can do this for you.

Michael,
is there any information about fpweb available except the sources? Any little example or something? I'd even buy any magazine (as long as it's german or english). The only thing I found so far is a mail in laz-ml in the middle of "Regenerate Makefiles?" thread ..

Now for something completely different: I don't get any mails from mantis since 2007-05-25 (fpc at bcsoft de). A few days ago, giantm tried to send me a testmail from that machine (idefix(?)), which never came through, but he couldn't check the maillogs there.

Last mail I got from mantis was:
Received: (qmail 25156 invoked by uid 30507); 25 May 2007 12:40:51 -0000 Subject: [Lazarus 0008943]: Fonts colors dont work with buttons, box, ect ...

regards
Burkhard

Reply by email

Michael Van Canneyt
to Burkhard Carstens
Burkhard Carstens wrote 12 lines
Am Dienstag, 5. Juni 2007 22:21 schrieb Michael Van Canneyt: > On Tue, 5 Jun 2007, Darius Blaszijk wrote: > > Hi I would like to upload a file through a web page. How can I do > > this using FPC? Is there any example available? > > The fpweb or cgiapp components can do this for you. Michael, is there any information about fpweb available except the sources? Any little example or something? I'd even buy any magazine (as long as it's german or english). The only thing I found so far is a mail in laz-ml in the middle of "Regenerate Makefiles?" thread ..

Sent a mail in private with 2 articles.

Michael.

Reply by email

Burkhard Carstens
to Michael Van Canneyt
Michael Van Canneyt wrote 15 lines
On Wed, 6 Jun 2007, Burkhard Carstens wrote: > Am Dienstag, 5. Juni 2007 22:21 schrieb Michael Van Canneyt: > > On Tue, 5 Jun 2007, Darius Blaszijk wrote: > > > Hi I would like to upload a file through a web page. How can I > > > do this using FPC? Is there any example available? > > > > The fpweb or cgiapp components can do this for you. > > Michael, > is there any information about fpweb available except the sources? > Any little example or something? I'd even buy any magazine (as long > as it's german or english). The only thing I found so far is a mail > in laz-ml in the middle of "Regenerate Makefiles?" thread .. Sent a mail in private with 2 articles.

Thanks!!!

Burkhard

Reply by email

Joao Morais
to Michael Van Canneyt: Sent a mail in private with 2 articles. Michael.
Michael Van Canneyt wrote 15 lines
On Wed, 6 Jun 2007, Burkhard Carstens wrote: > Am Dienstag, 5. Juni 2007 22:21 schrieb Michael Van Canneyt: >> On Tue, 5 Jun 2007, Darius Blaszijk wrote: >>> Hi I would like to upload a file through a web page. How can I do >>> this using FPC? Is there any example available? >> The fpweb or cgiapp components can do this for you. > Michael, > is there any information about fpweb available except the sources? Any > little example or something? I'd even buy any magazine (as long as it's > german or english). The only thing I found so far is a mail in laz-ml > in the middle of "Regenerate Makefiles?" thread .. Sent a mail in private with 2 articles.

Hmmm... what about a link?

Thanks.

Joao Morais

Reply by email

Michael Van Canneyt
to Joao Morais
Joao Morais wrote 18 lines
Michael Van Canneyt wrote: > > On Wed, 6 Jun 2007, Burkhard Carstens wrote: > > > Am Dienstag, 5. Juni 2007 22:21 schrieb Michael Van Canneyt: > > > On Tue, 5 Jun 2007, Darius Blaszijk wrote: > > > > Hi I would like to upload a file through a web page. How can I do > > > > this using FPC? Is there any example available? > > > The fpweb or cgiapp components can do this for you. > > Michael, > > is there any information about fpweb available except the sources? Any > > little example or something? I'd even buy any magazine (as long as it's > > german or english). The only thing I found so far is a mail in laz-ml in > > the middle of "Regenerate Makefiles?" thread .. > > Sent a mail in private with 2 articles. Hmmm... what about a link?

Can't do, because I'm not allowed to distribute it publicly, so it's only on request.

Michael.

Reply by email

Burkhard Carstens
to Michael Van Canneyt: The fpweb or cgiapp components can do this for you. Michael.
Michael Van Canneyt wrote 5 lines
On Tue, 5 Jun 2007, Darius Blaszijk wrote: > Hi I would like to upload a file through a web page. How can I do > this using FPC? Is there any example available? The fpweb or cgiapp components can do this for you.

The README.TXT in lazarus/components/fpweb/ states: "fpWeb does not work with fpc 2.0.4.
It needs at least 2.3.x."

Is 2.3.x still minimum, or could it work with 2.1.4/2.1.5, too?

I've been able to install the weblaz package in lazarus with fpc-2.1.5, but I can't compile an apache module due to missing fpApache unit.

fpApache seems to be missing in packages/fcl-web/Makefile.fpc in fixes_2_2 as well as in trunk.
Simply adding fpApache to the Makefile.fpc (and doing the fpcmake -Tall) doesn't solve it: "can't find unit httpd used by fpApache". Here I'm loosing it. From the buildlog I can see, that there is no -Fu{fpcsrc}/packages/base/httpd/ when compiling fpApache, even though httpd-1.3 -2.0 and 2.2 are compiled before.

any hints?

regards
Burkhard

Reply by email

Michael Van Canneyt
to Burkhard Carstens
Burkhard Carstens wrote 12 lines
Am Dienstag, 5. Juni 2007 22:21 schrieb Michael Van Canneyt: > On Tue, 5 Jun 2007, Darius Blaszijk wrote: > > Hi I would like to upload a file through a web page. How can I do > > this using FPC? Is there any example available? > > The fpweb or cgiapp components can do this for you. The README.TXT in lazarus/components/fpweb/ states: "fpWeb does not work with fpc 2.0.4. It needs at least 2.3.x." Is 2.3.x still minimum, or could it work with 2.1.4/2.1.5, too?

It could, except the apache support.

Show quoted text 13 lines
I've been able to install the weblaz package in lazarus with fpc-2.1.5, but I can't compile an apache module due to missing fpApache unit. fpApache seems to be missing in packages/fcl-web/Makefile.fpc in fixes_2_2 as well as in trunk. Simply adding fpApache to the Makefile.fpc (and doing the fpcmake -Tall) doesn't solve it: "can't find unit httpd used by fpApache". Here I'm loosing it. From the buildlog I can see, that there is no -Fu{fpcsrc}/packages/base/httpd/ when compiling fpApache, even though httpd-1.3 -2.0 and 2.2 are compiled before. any hints?

Hm. As far as I know, it should build - it builds here. The problem may be that your fpcmake is outdated. I think peter or me did some fixes in fpcmake.

Michael.

Reply by email

Burkhard Carstens
to Michael Van Canneyt
Michael Van Canneyt wrote 15 lines
On Wed, 6 Jun 2007, Burkhard Carstens wrote: > Am Dienstag, 5. Juni 2007 22:21 schrieb Michael Van Canneyt: > > On Tue, 5 Jun 2007, Darius Blaszijk wrote: > > > Hi I would like to upload a file through a web page. How can I > > > do this using FPC? Is there any example available? > > > > The fpweb or cgiapp components can do this for you. > > The README.TXT in lazarus/components/fpweb/ states: > "fpWeb does not work with fpc 2.0.4. > It needs at least 2.3.x." > > Is 2.3.x still minimum, or could it work with 2.1.4/2.1.5, too? It could, except the apache support.

:-) Ok, then I'll skip the apache support for now and start playing with the cgi stuff. seems to be easy portable later.

Show quoted text 17 lines
> I've been able to install the weblaz package in lazarus with > fpc-2.1.5, but I can't compile an apache module due to missing > fpApache unit. > > fpApache seems to be missing in packages/fcl-web/Makefile.fpc in > fixes_2_2 as well as in trunk. > Simply adding fpApache to the Makefile.fpc (and doing the fpcmake > -Tall) doesn't solve it: "can't find unit httpd used by fpApache". > Here I'm loosing it. From the buildlog I can see, that there is no > -Fu{fpcsrc}/packages/base/httpd/ when compiling fpApache, even > though httpd-1.3 -2.0 and 2.2 are compiled before. > > any hints? Hm. As far as I know, it should build - it builds here. The problem may be that your fpcmake is outdated. I think peter or me did some fixes in fpcmake.

fpcmake -V says 2.0.0 from today. It's from fixes_2_2 svnrev 7559. I didn't experiment with fpc-trunk, cause currently it seems too "hot". However, I checked it out and searched all Makefiles as well as *.fpc and there is absolutely no appearance of "fpapache" .. so I don't understand why/how it should be compiled.

regards
Burkhard

Reply by email

Darius Blaszijk
to Michael Van Canneyt: The fpweb or cgiapp components can do this for you. Michael.

Thanks to all for their help. For now I will stick to psp because I need it to work with 2.0.4.

Darius

Michael Van Canneyt wrote 16 lines
On Tue, 5 Jun 2007, Darius Blaszijk wrote: > Hi I would like to upload a file through a web page. How can I do this using > FPC? Is there any example available? > The fpweb or cgiapp components can do this for you. Michael. _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email

Graeme Geldenhuys
to Darius Blaszijk

Hi Darius,

Did you ever manage to get an example of uploading a file? I've got a CGI app based on Powtils or PSP or whatever it's called these days. My CGI app needs to permit uploading of files, but I got no idea how to do it.

Regards,
- Graeme -

Darius Blaszijk wrote 21 lines
Thanks to all for their help. For now I will stick to psp because I need it to work with 2.0.4. Darius Michael Van Canneyt wrote: > On Tue, 5 Jun 2007, Darius Blaszijk wrote: > > > > > Hi I would like to upload a file through a web page. How can I do this using > > FPC? Is there any example available? > > > > > > The fpweb or cgiapp components can do this for you. > > Michael.

Reply by email

Leonardo M. Ramé
to Graeme Geldenhuys

If you checkout Powtils from svn at http://powtils.googlecode.com/svn/dev you'll find an example inside examples/upload-file.

Leonardo M. Ramé
http://leonardorame.blogspot.com

Graeme Geldenhuys wrote 48 lines
From: Graeme Geldenhuys Subject: Re: [fpc-pascal] CGI upload app To: "FPC-Pascal users discussions" Date: Tuesday, November 4, 2008, 5:45 AM Hi Darius, Did you ever manage to get an example of uploading a file? I've got a CGI app based on Powtils or PSP or whatever it's called these days. My CGI app needs to permit uploading of files, but I got no idea how to do it. Regards, - Graeme - On 6/6/07, Darius Blaszijk wrote: > Thanks to all for their help. For now I will stick to psp because I need it > to work with 2.0.4. > > Darius > > > Michael Van Canneyt wrote: > > > On Tue, 5 Jun 2007, Darius Blaszijk wrote: > > > > > > > > > Hi I would like to upload a file through a web page. How can I do this > using > > > FPC? Is there any example available? > > > > > > > > > > The fpweb or cgiapp components can do this for you. > > > > Michael. _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email

Lukas Gradl
to Graeme Geldenhuys: Did you ever manage to get an example of uploading a file? I've got a CGI app based on…
Show quoted text 9 lines
Hi Darius, Did you ever manage to get an example of uploading a file? I've got a CGI app based on Powtils or PSP or whatever it's called these days. My CGI app needs to permit uploading of files, but I got no idea how to do it. Regards, - Graeme -

You just want to upload a file to a server using a CGI running on that server?
I did this with cgiapp contained in the fpc-web package.

It's quite simple - if needed I could extract the relevant lines out of my (quite complex) CGI tomorrow and create a compilable example.

The relevant parts are:

uses cgiapp,...;

....

Type
   TYourNewCGI = Class(TCGIApplication)
     Procedure DoRun; override;
   end;

.....

procedure TYourNewCGI.DoRun;
Var RcvStream:TMemoryStream;
     SndStream:TMemoryStream;
     L:TStringList;
begin
   RcvStream:=TMemoryStream.Create;
   SndStream:=TMemoryStream.Create;
   L:=TStringList.Create;
   try
     If (RequestVariableCount>0) then begin
       GetRequestVarList(L,True);
       for i:=0 to L.Count-1 do begin
         if VariableIsUploadedFile(L[i]) then begin
           RcvStream.LoadFromFile(UploadedFileName(L[i]));
         end;
       end;
     end;
     AddResponseLn('Content-Disposition: inline; filename="data.txt"
              Content-Type: application/txt;');
     AddResponseLn('');
     SndStream.LoadFromFile('FileToSendBack.txt');
     SndStream.Seek(0,soBeginning);
     Response.CopyFrom(SndStream,SndStream.Size);
   finally
     RcvStream.Free;
     SndStream.Free;
     L.Free;
     Terminate;
   end;
end;
begin
   With TYourNewCGI.Create(Nil) do begin
     try
       Title:='YourNewCGI';
       Initialize;
       Run;
     Finally
       Free;
     end;
   end;
end.

Regards
Lukas

-------------------------- software security networks Lukas Gradl <fpc#ssn.at> Eduard-Bodem-Gasse 9 A - 6020 Innsbruck Tel: +43-512-214040-0 Fax: +43-512-214040-21 --------------------------

Reply by email

Graeme Geldenhuys
to Henry Vermaak: 2008/11/4 Graeme Geldenhuys : i can see it here:…
Henry Vermaak wrote

Ah dope!!! Stupid me. I saw ".." and "up" and figured that's the web servers "browse a directory" auto generated interface. "up" being - go to the previous directory. :-/

Thanks Henry!

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

FOFPC
to Darius Blaszijk: Hi I would like to upload a file through a web page. How can I do this using FPC? Is…

download the tool from

http://fofpc.org/tools/

also library has some articles regarding your issue

Darius Blaszijk wrote 10 lines
Hi I would like to upload a file through a web page. How can I do this using FPC? Is there any example available? Darius _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal
View this message in context: http://www.nabble.com/CGI-upload-app-tp10971554p24284641.html Sent from the Free Pascal - General mailing list .

Reply by email

Vincent Snijders
to FOFPC
FOFPC wrote 8 lines
download the tool from http://fofpc.org/tools/ also library has some articles regarding your issue

at 6-6-2007 19:23

Darius Blaszijk wrote: > Hi I would like to upload a file through a web page. How can I do this > using FPC? Is there any example available?

I wonder if Darius is still looking for an answer after more than 2 year ...

Vincent

Reply by email

Graeme Geldenhuys
to Vincent Snijders
Vincent Snijders wrote
I wonder if Darius is still looking for an answer after more than 2 year ...

Well, in commercial terms (or like most companies here in RSA), that reply was instant! :-)

Either way, it's good to know that you will get an answer in this mailing list, no matter how long it takes. ;-)

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/

Reply by email