Welcome, Guest |
You have to register before you can post on our site.
|
Online Users |
There are currently 417 online users. » 0 Member(s) | 413 Guest(s) Applebot, Bing, Facebook, Google
|
Latest Threads |
Call TPicture.Assign in a...
Forum: IntraWeb General Discussion
Last Post: lmengyew
Yesterday, 09:48 AM
» Replies: 0
» Views: 29
|
Http.sys application prom...
Forum: IntraWeb General Discussion
Last Post: lmengyew
Yesterday, 08:25 AM
» Replies: 2
» Views: 724
|
IntraWeb Bootstrap4 - dem...
Forum: IntraWeb General Discussion
Last Post: jindrich.volek
04-25-2024, 03:16 PM
» Replies: 0
» Views: 61
|
Dummy div in a IWRegion
Forum: IntraWeb General Discussion
Last Post: StephB
04-24-2024, 03:58 PM
» Replies: 2
» Views: 110
|
Create components at runt...
Forum: IntraWeb General Discussion
Last Post: PaulWeem
04-23-2024, 10:27 PM
» Replies: 1
» Views: 124
|
message when added TIWDBN...
Forum: IntraWeb General Discussion
Last Post: Mike_A
04-22-2024, 02:09 PM
» Replies: 6
» Views: 1,279
|
303 Redirect and Response...
Forum: IntraWeb General Discussion
Last Post: ALW2019
04-22-2024, 01:25 PM
» Replies: 3
» Views: 547
|
IW 15.5.9 IWChart
Forum: IntraWeb General Discussion
Last Post: PaulWeem
04-22-2024, 07:16 AM
» Replies: 2
» Views: 255
|
Data Decimation in ChartJ...
Forum: IntraWeb General Discussion
Last Post: iwuser
04-22-2024, 06:51 AM
» Replies: 8
» Views: 1,613
|
ClassicRegionDraw
Forum: IntraWeb General Discussion
Last Post: JuergenS
04-17-2024, 05:35 PM
» Replies: 0
» Views: 164
|
|
|
IW15 FileUplader and GetUploadedFileMimeType |
Posted by: cprmlao@hotmail.com - 10-16-2019, 01:37 PM - Forum: IntraWeb General Discussion
- Replies (20)
|
|
Hi,
Intraweb XIV iwfileuploader demo has the next code.
It seems 'GetUploadedFileMimeType' is contained inm IWFileCheck.pas not present in the folder.
What is the equivalent to 'GetUploadedFileMimeType' in IW 15?
Regards, Luiz
Code: procedure TIWForm7.IWFileUploader5AsyncUploadCompleted(Sender: TObject;
var DestPath, FileName: string; var SaveFile, Overwrite: Boolean);
var
CurDir: string;
MimeType: string;
begin
// get the app path
CurDir := TIWAppInfo.GetAppPath;
MimeType := GetUploadedFileMimeType;
// save in the same application directory, with the same name of the original file. Overwrite if it already exists.
IWFileUploader5.SaveToFile(FileName, CurDir + FileName, True);
// Inform IWFileUploader that we are taking care of file saving ourselves
SaveFile := False;
end;
|
|
|
Error handling |
Posted by: SWTwo6 - 10-16-2019, 12:16 PM - Forum: IntraWeb General Discussion
- Replies (3)
|
|
In IntraWeb XI, I was able to use the URLReposnders to use a self-registered Error page, that I could then run code on. I'm trying to work out the best way to replicate this behaviour in IWXV
I don't want to use a static page or a template, because I want to run my own code on the page. I've tried using a TerminateAndRedirect on the OnException, but it doesn't appear to have any effect (it is being called, but the browser still gets sent to the Intraweb error page)
Can anyone point me in the right direction?
|
|
|
Minimal SSL TCPClient and server, VCL |
Posted by: logihouse - 10-15-2019, 08:48 PM - Forum: Indy General Discussion
- Replies (6)
|
|
Minimal SSL TCPServer and client
I am using delphi version 10.3.1 .
No certificate, it is not mandatory.
No errormessages, but only rubbish received in ServerExecute. Works fine when UseSSL = false;
Any ideas?
Place a button on an empty form, and link it to Button1Click.
Code: unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, uIdContext, IdContext,
IdServerIOHandler, IdSSL, IdSSLOpenSSL, IdBaseComponent, IdComponent,
IdCustomTCPServer, IdTCPServer, Vcl.StdCtrls, IdIOHandler, IdIOHandlerSocket,
IdIOHandlerStack, IdTCPConnection, IdTCPClient;
type
TForm1 = class(TForm)
Server: TIdTCPServer;
Client: TIdTCPClient;
cSSL: TIdSSLIOHandlerSocketOpenSSL;
Button1: TButton;
SSL: TIdServerIOHandlerSSLOpenSSL;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure ServerExecute(AContext: TIdContext);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
const usessl = false;
procedure TForm1.Button1Click(Sender: TObject);
begin
Client.Connect;
Client.IOHandler.WriteLn('test');
Client.Disconnect;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Server:= TIdTCPServer.Create;
Server.DefaultPort := 443;
Client:= TIdTCPClient.Create;
Client.Host := 'Localhost';
Client.Port := 443;
Server.OnExecute := ServerExecute;
if UseSSL then
begin
cSSL:= TIdSSLIOHandlerSocketOpenSSL.Create;
SSL:= TIdServerIOHandlerSSLOpenSSL.Create;
SSL.SSLOptions.Mode := sslmServer;
SSL.SSLOptions.VerifyMode := [];
SSL.SSLOptions.VerifyDepth := 0;
SSL.SSLOptions.SSLVersions := [sslvSSLv2..sslvTLSv1_2];
TIdSSLIOHandlerSocketBase(cSSL).PassThrough := false;
cSSL.SSLOptions.Mode := sslmClient;
cSSL.SSLOptions.VerifyMode := [];
cSSL.SSLOptions.VerifyDepth := 0;
cSSL.SSLOptions.SSLVersions := [sslvSSLv2..sslvTLSv1_2]; // Avoid using SSL}
Server.IOHandler := SSL; // TIdServerIOHandlerSSLOpenSSL
Client.IOHandler := cSSL; // TIdSSLIOHandlerSocketOpenSSL
end;
Server.Active := true;
end;
procedure TForm1.ServerExecute(AContext: TIdContext);
var s : string;
begin
s := aContext.Connection.IOHandler.Alldata;
s := s;
end;
end.
|
|
|
Warning from Datatables |
Posted by: matija - 10-15-2019, 08:53 AM - Forum: IntraWeb General Discussion
- Replies (4)
|
|
I create my HTML table (datatables.net) include IWLabel raw text
<table id="mytable" class="table table-hover table-striped table-condensed dt-responsive nowrap" width="100%" cellspacing="0">
...
</table>
I have in my HTML template {%mytable%} and this style:
<style>
.sunday {
background-color: red !important;
}
</style>
After view IWLabel send (color row with red which are sunday):
WebApplication.CallBackResponse.AddJavaScriptToExecute
('$(document).ready( function () {'
+ 'var table = $("#mytable").DataTable({'
+ '"createdRow": function(row, data, dataIndex)'
+ '{ if (data[2] == "sun") {$(row).addClass("sunday");} }'
+ '});'
+ '}) ');
After AddJavaScriptToExecute get it:
DataTables warning: Non-table node initialisation (SPAN). For more information about this error, please see http://datatables.net/tn/2
|
|
|
PReventing a second tab from opening the same session |
Posted by: SWTwo6 - 10-14-2019, 11:29 AM - Forum: IntraWeb General Discussion
- Replies (1)
|
|
How do?
I don't want to use the session ID in the URL, as we want to support users bookmarking the page easily, and we need cookies enabled to allow the back button GlobalIntercept functionality to work as advertised, so I'm unable to use either of the "Mutliple independant sessions" options.
Is there any method by which I can force the session to only be valid in one browser window or tab at a time? Either by preventing a second tab from loading, or disabling the first tab on loading a second?
|
|
|
TCPClient SSL on Android |
Posted by: BartKindt - 10-12-2019, 10:16 PM - Forum: Indy General Discussion
- Replies (9)
|
|
I got a debug report from an Android user, where this happened:
The Client receives a "StartTLS" from the IdTCPServer (Part of my code).
The Client responces with a "STARTTLS" back, then does a Sleep(1000) (this solves some timing issues) and then switches the Passthrough to FALSE:
sleep(1000);
IdSSLIOHandlerSocketOpenSSL1.PassThrough := false;
The SSL Negotiating starts, and gets to this:
[S] [06:21:09Z] SSL StatusInfo: SSL status: "before/connect initialization"
[S] [06:21:09Z] SSL StatusInfo: SSL status: "before/connect initialization"
[S] [06:21:09Z] SSL StatusInfo: SSL status: "SSLv3 write client hello A"
[S] [06:21:09Z] SSL StatusInfo: SSL status: "SSLv3 write client hello A"
And then it stops. And there is no Exception raised.
The Internet connection is very unreliable at this point, and I expect there may have been major packet loss.
But the system did not recover from this situation, as there was no exception raised, it just hung there.
Question:
- At which point does the SSL negotiation start: Immediatly after PassThrough := false, OR after the first attempt to send data over the link?
- When the Internet connection fails at this point, (and possibly the *Server* got a TCP Reset) is should there be a time-out exception being raised? Because the actual TCP connection is already established.
Thanks, Bart
|
|
|
|