| Welcome, Guest |
You have to register before you can post on our site.
|
| Latest Threads |
Reproducible IIS crash in...
Forum: IntraWeb General Discussion
Last Post: alex.trejo@tttnet.com.mx
09-21-2026, 05:33 PM
» Replies: 1
» Views: 367
|
WebApplication.IP change ...
Forum: IntraWeb General Discussion
Last Post: alex.trejo@tttnet.com.mx
09-21-2026, 05:31 PM
» Replies: 2
» Views: 408
|
Hook/callback to handle t...
Forum: IntraWeb General Discussion
Last Post: Lenfors
09-08-2026, 09:03 AM
» Replies: 0
» Views: 312
|
The packages IW16.xx inc...
Forum: IntraWeb General Discussion
Last Post: hsbelli
09-03-2026, 11:46 AM
» Replies: 2
» Views: 655
|
Redirection issues with F...
Forum: IntraWeb General Discussion
Last Post: magosk
08-31-2026, 10:03 AM
» Replies: 0
» Views: 381
|
Source Code
Forum: IntraWeb General Discussion
Last Post: magosk
08-31-2026, 08:11 AM
» Replies: 3
» Views: 824
|
TContenthandler requires ...
Forum: IntraWeb General Discussion
Last Post: valmeras
08-30-2026, 02:35 AM
» Replies: 0
» Views: 337
|
TIWjQDBGrid erratic behav...
Forum: IntraWeb General Discussion
Last Post: alex.trejo@tttnet.com.mx
08-20-2026, 05:12 PM
» Replies: 8
» Views: 2,528
|
Change Language DataTable
Forum: IntraWeb General Discussion
Last Post: Rigoberto Mercedes
08-19-2026, 03:21 PM
» Replies: 1
» Views: 502
|
How to terminate HTTP Thr...
Forum: Indy
Last Post: rlebeau
08-14-2026, 08:01 AM
» Replies: 5
» Views: 1,227
|
|
|
| IdTcpServer Kick Client (Disconnect) INVALID HANDLE Exception |
|
Posted by: 3ddark - 06-17-2020, 05:58 PM - Forum: Indy
- Replies (3)
|
 |
Hello everybody,
I have a TCP Server application as ConsoleApp. Sometimes i need Disconnect to some client/s. I use like this code in main loop.
But I get an error after Disconnect ----> INVALID HANDLE
I gues(probally) after disconnect then lost thread handle.
How to solve this issue
Code: var
LList: TList;
n1: Integer;
begin
while True do
begin
Sleep(1);
LList := IdTCPServer1.Contexts.LockList;
try
for n1 := 0 to LList.Count-1 do
if TIdContext(LList[n1]).IsKickedClient then
TIdContext(LList[n1]).Connection.Disconnect;
finally
IdTCPServer1.Contexts.UnlockList;
LList := nil;
end;
end;
end;
|
|
|
| upload image with php file |
|
Posted by: Madammar - 06-17-2020, 05:05 PM - Forum: Delphi General Discussion
- Replies (2)
|
 |
i have this uploading php script
Code: <?php
/* Check if file already exists in location file save */
$fdirectory = "uploads/";
if (!file_exists($fdirectory)) {
die('You Need To Create uploads Folder before start uploading..<br> <b>Dont Forget To Give Premission 777 To the Folder</b>');
}
if (isset($_POST['upload'])) {
$imgsize = $_FILES['image']['size'];
$image_name = $_FILES['image']['name'];
$image_tempname = $_FILES['image']['tmp_name'];
$image_type = getimagesize($image_tempname);
$image_ext = explode('.',$image_name);
$ext = strtolower(end($image_ext));
$FileError = $_FILES['image']['error'];
$allow_ext = array('png','jpg','gif','jpeg','bmp');
$allow_type = array('image/png','image/gif','image/jpeg','image/bmp');
if (in_array($ext, $allow_ext) && in_array($image_type['mime'], $allow_type)) {
if ($FileError === 0) {
if ($imgsize < 300000) {
list($width, $height, $mime) = $image_type;
if ($width>0 && $height>0) {
#do Upload
$NewImageName = uniqid('', true).".".$ext;
$moveImg = $fdirectory.$NewImageName;
$upload = move_uploaded_file($image_tempname, $moveImg);
if ($upload) {
header("Location: imgup.php?img=".$moveImg ."");
exit;
} else {
header("Location: imgup.php?res=failed");
exit;
} # end check if uploaded
} else {
header("Location: imgup.php?res=error");
exit;
}# image width check
} else {
header("Location: imgup.php?res=large");
exit;
} # File size check end
} else {#FileError
header("Location: imgup.php?res=error");
exit;
}
} else { # end of sec check
header("Location: imgup.php?res=error");
exit;
}
/* isset check end*/
}
?>
and i am using httpclient to post the file to php like following
Code: HttpClient := THTTPClient.Create;
try
HttpClient.AllowCookies := True;
HttpClient.UserAgent := sUserAgent;
HttpClient.HandleRedirects := True;
HttpClient.MaxRedirects := 3;
HTTPClient.ConnectionTimeout := 0;
HTTPClient.ResponseTimeout := 0;
PostData := TIdMultipartFormDataStream.Create;
try
try
PostData.AddFile('image', FFileToUpload);
HttpResponse := HttpClient.Post(FdataURL, PostData);
FoutData := HttpResponse.ContentAsString();
except
end;
finally
PostData.Free;
end;
finally
HttpClient.Free;
end;
but the image doesnt seems to get uploaded and i get an empty response
what i am doing wrong ?
in html it works fine
Code: <form action="upload.php" method="post" enctype="multipart/form-data">
<div class="form-group file-area">
<input type="file" accept="image/*" name="image" id="images">
</div>
<div class="form-group">
<button type="submit" name="upload">Upload image</button>
</div>
</form>
|
|
|
| Content handlers |
|
Posted by: dbrain23 - 06-13-2020, 11:55 PM - Forum: IntraWeb General Discussion
- Replies (1)
|
 |
I am currently developing a multi-form app using templates. In my master template, I've got the following:
<div class="vertical-menu">
<a href="/dashboard/">Dashboard</a>
<a href="/profile/">Profile</a>
<a href="/leaves/">Leaves</a>
</div>
In my ServerController under the initialization section:
initialization
TIWServerController.SetServerControllerClass;
THandlers.Add('', '/dashboard/', TContentForm.Create(TDashboardForm));
THandlers.Add('', '/profile/', TContentForm.Create(TProfileForm));
THandlers.Add('', '/leaves/', TContentForm.Create(TLeavesForm));
1. Would this be a better approach compared to explicitly creating the form?
2. When the TContentForm.Create(<formclass>) is called, does it release the previously-opened form?
3. Is the TContentForm.Create(<formclass>) instantiated in the context of the UserSession?
Hope this makes sense.
|
|
|
| Fulgan OpenSSL libraries : prohibited access |
|
Posted by: controlhorus - 06-12-2020, 11:10 PM - Forum: Indy
- Replies (7)
|
 |
Hello
I updated my Delphi 2009 from Indy 10.2.5 to Indy 10.6.2.0
I am using OpenSSL libraries version 1.0.2o.
I have tried to access https://indy.fulgan.com/SSL/Archive/ and I get this error:
You don't have permission to access /SSL/Archive/ on this server.
Are rhe dlls available on any other site?
My initial problem:
I have been using these libraries to connect to several servers.
Now I am trying to connect to a new https site who gives me Connection reset by peer on SSL Client hello packet sended.
I forced TLSv1.2 and CipherList only with the Cipher Postman uses, but it still does not work.
Thanks and good health
|
|
|
| How to Format IWEdit |
|
Posted by: Rolphy Reyes - 06-12-2020, 02:51 PM - Forum: IntraWeb General Discussion
- Replies (4)
|
 |
Hi!
Since IW 15.1.11 the IWEdit acquired many features by the new property DataType. This property has the stDate as option.
How can I ensure the format of the IWEdit?
I would like that the IWEdit always has the date format 'dd/mm/yyyy' no matter the browser or dispositive the user use to open the application.
How can I achieve that?
|
|
|
|