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

Mailing lists / fpc-pascal / 2007-06
21 messages · 11 people · –
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
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
Darius Blaszijk wroteHi I would like to upload a file through a web page. How can I do this using FPC? Is there any example available?
Hi,
You can use PSP : http://psp.furtopia.org/cgi-bin/psp/download.psp I wrote a e-commerce website in just a few days with it, it's very efficient !
Marc
Hi I would like to upload a file through a web page. How can I do this using FPC? Is…
Darius Blaszijk wroteHi 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.
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
Sent a mail in private with 2 articles.
Michael.
Thanks!!!
Burkhard
Sent a mail in private with 2 articles. Michael.
Hmmm... what about a link?
Thanks.
Can't do, because I'm not allowed to distribute it publicly, so it's only on request.
Michael.
The fpweb or cgiapp components can do this for you. Michael.
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
It could, except the apache support.
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.
:-) Ok, then I'll skip the apache support for now and start playing with the cgi stuff. seems to be easy portable later.
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
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
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 -
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
Leonardo M. Ramé wroteIf you checkout Powtils from svn at http://powtils.googlecode.com/svn/dev you'll find an example inside examples/upload-file.
Thanks, but all the example directories are empty. :-(
Regards,
- Graeme -
_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
2008/11/4 Graeme Geldenhuys :
i can see it here:
http://powtils.googlecode.com/svn/dev/examples/upload-file/up.dpr
henry
Did you ever manage to get an example of uploading a file? I've got a CGI app based on…
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
2008/11/4 Graeme Geldenhuys : i can see it here:…
Henry Vermaak wrotei can see it here: http://powtils.googlecode.com/svn/dev/examples/upload-file/up.dpr
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/
Hi I would like to upload a file through a web page. How can I do this using FPC? Is…
download the tool from
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
Vincent Snijders wroteI 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 -