[Gambas-user] How to share files using gb.web?
T Lee Davidson
t.lee.davidson at gmail.com
Mon Nov 20 17:05:56 CET 2023
On 11/20/23 00:48, Филипп Друан via User wrote:
> Hello!
>
> I would like to write a program in Gambas that creates a web page with links to previously specified files. The files can be
> any, they can be indicated in the interface installed on the server. The server may be any computer.
>
> Please tell me if it is difficult to implement my idea?
It is not difficult at all. You just include, in your WebPage, the anchor tag that specifies the file to be downloaded:
<a href="file-to-download.txt">Download File</a>
You can hard code the anchor or generate it dynamically with Gambas.
> Will Gambas significantly slow down data transfer speed compared to Nginx?
As BB explained, Gambas has nothing to do with the downloading of a file. That is handled by the web server (such as Apache,
lighttpd, Nginx, etc.) and the user's browser. The gb.web component is not a web server. It is based on CGI and allows one to
dynamically generate web pages similar to how PHP, ASP, and JSP operate.
To get an idea of how gb.web's WebPage works, try this:
1. In Gambas IDE, choose to create a new project,
2. For Project type, choose Web application (example code will be generated for you),
3. Once you have created the project, go to Debug > Configuration, and turn on "Use embedded HTTP server"
4. You can now run the project from the IDE (see what it does?), then
5. Either before or after the <table>, add in an anchor tag to link any file you wish,
6. Click the "Compile all" button and run the project again.
--
Lee
More information about the User
mailing list