Recent

Author Topic: simple standalone HTTP File server.  (Read 9450 times)

rasberryrabbit

  • Full Member
  • ***
  • Posts: 151
simple standalone HTTP File server.
« on: May 28, 2014, 05:15:42 am »
Simple standalone Http file server.
It has no problem with Huge file upload.  :D

It need LNet Visual for compile.

example application
http://www.mediafire.com/download/75g4h8358tx885l/webfilelnet32.zip

(updated) FileExists is not properly work on Linux, change processing order and works on linux well.

(updated) Refine folder creation function.

(updated) Refine message logging component, work well with gtk2 and windows.

example html.
form action must have 'upload.action.htm'.
Code: [Select]
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head>
<body>
<div>
<form name="folder" method="get" action="/%ED%95%98%ED%95%98/%EB%AC%B4%EC%96%B4%EB%AC%B4%EC%96%B4/upload.action.htm" enctype="multipart/form-data">
<input type="text" name="folder" value="">
<input type="submit" value="create">
</div>
<p><hr /></p>
<div>
<form name="file" method="post" action="/%ED%95%98%ED%95%98/%EB%AC%B4%EC%96%B4%EB%AC%B4%EC%96%B4/upload.action.htm" enctype="multipart/form-data">
<input type="file" name="fileupload">
<input type="file" name="fileupload">
<input type="file" name="fileupload">
<input type="submit" value="send">
<input name="MAX_FILE_SIZE" value="1073741824" type="hidden" /></form>
</div><p><hr /></p>
</body></html>
« Last Edit: July 09, 2014, 06:06:22 am by parcel »
Code is long, Life is short, AI is not your enemy.

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: simple standalone HTTP File server.
« Reply #1 on: May 29, 2014, 01:20:20 pm »
Interesting. How does it compare to the lazwebextra package that is supplied with Lazarus (but not installed by default)?
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Leledumbo

  • Hero Member
  • *****
  • Posts: 8836
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: simple standalone HTTP File server.
« Reply #2 on: May 29, 2014, 02:25:19 pm »
Interesting. How does it compare to the lazwebextra package that is supplied with Lazarus (but not installed by default)?
I think it's better to say: how does it compare to fcl-web's TFPHTTPServer?

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: simple standalone HTTP File server.
« Reply #3 on: May 29, 2014, 02:38:16 pm »
AFAIU, they're the same thing, aren't they ;)
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Leledumbo

  • Hero Member
  • *****
  • Posts: 8836
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: simple standalone HTTP File server.
« Reply #4 on: May 29, 2014, 03:19:01 pm »
AFAIU, they're the same thing, aren't they ;)
Well not really, TFPHTTPServer can be accessed without installing lazwebextra. The package only installs some wizards + html menu (which I find somewhat useless, my hand codes faster than that).

rasberryrabbit

  • Full Member
  • ***
  • Posts: 151
Re: simple standalone HTTP File server.
« Reply #5 on: May 30, 2014, 05:25:12 am »
Interesting. How does it compare to the lazwebextra package that is supplied with Lazarus (but not installed by default)?
I think it's better to say: how does it compare to fcl-web's TFPHTTPServer?

I made same http server with 'TFPHTTPServer', but there is a problem on big files.
'TFPHTTPServer' store uploaded http stream data in memory and then stored temp files.
It's big problem for me and I resolve that problem.
'TFPHTTPServer' http socket class overriding cannnot work for me.

My solution is store file directly dest location and not store whole file stream data in memory.
You can upload unlimited size of files with my unit.
Code is long, Life is short, AI is not your enemy.

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: simple standalone HTTP File server.
« Reply #6 on: May 30, 2014, 11:32:05 am »
Interesting, thanks for the explanation!
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

 

TinyPortal © 2005-2018