Post by Remy Lebeau (TeamB)There you go then. You will have to simulate a login before you can then
downloaded protected files. What EXACTLY is the server expecting? Do you
have to fill in a web form? Or does the browser display a popup
user/password dialog instead?
Post by AxelProbably i must use twebbrowser as i use before I reach the download
point we are talking about, and with a external program interact with
the IE download windows (as i do in another application yet).
You will not have to do that.
Gambit
I try to explain all..
I use some function to interact with a IE browser windows. (some function
are written after)
I open a site, fill some field (user, pass, id) choose the desidered menu,
finally i make a order of some file.
The server after some time gets ready this files in a specific menu.
The html code of this page is written after.
At this point i would like to simply download this files without use the
webbrower method to skip the popup Ie download windows ecc..
Probably I have to "say" something to idhttp ....
Infact if i try to use the link
(https://bollettinoreport.poste.it/bollettinoreport/98422.zip?idRichiesta=98422
) from other Pc without log in, the file downloaded is empty. The situation
is similar or equal.
I think that there was many mechanism that protect the process and is very
difficult (or impossible) recreate all using tidhttp....but if you
contraddict me.... i will be the happiest man in this land!!
TIA
Function TScaricaImmaginiBp.SelezionaFinestra(LnomeFinestra:string):boolean;
var
k: Integer;
begin
result:=false;
ShellWindow := CoShellWindows.Create;
for k := 0 to ShellWindow.Count-1 do
try
if pos(lowercase(LnomeFinestra),lowercase((ShellWindow.Item(k) as
IWebbrowser2).LocationUrl))>0 then
begin
result:=true;
spDisp := ShellWindow.Item(k);
spDisp.QueryInterface(iWebBrowser2, WB1);
if WB1 <> nil then
begin
WB1.Document.QueryInterface(IHTMLDocument2, iDoc1);
if iDoc1 <> nil then
begin
WB1 := ShellWindow.Item(k) as ShDocVW_TLB.IWebbrowser2;
Document := WB1.Document;
// exit;
end;
end;
end;
except
end;
end;
function
TScaricaImmaginiBp.ConnettiEautentica(lCodiceAzienda,lUser,lPwd:string):boolean;
begin
result:=false;
ShellExecute(IeHndl, 'open',PChar(K_URL_AUTH1), nil, nil, SW_SHOWMINIMIZED);
if Assigned(FOnChangeState) then FOnChangeState(K_MSG01);
fTimer.Enabled:=true;
sleep(200);
if not Visibile then ManageWindow('BancoPostaImpresa',SW_HIDE);
repeat
Application.ProcessMessages;
if fStato=TimeOutEd then
begin
if Assigned(FOnChangeState) then
FOnChangeState(K_MSG10);
exit;
end;
if SelezionaFinestra('BancoPostaImpresa') then
begin
if Assigned(FOnChangeState) then FOnChangeState(K_MSG02);
if (
FillFormNoFrame(K_FORM_Id_azienda,lcodiceAzienda)
and FillFormNoFrame(K_FORM_user,luser)
and FillFormNoFrame(K_FORM_Pass,lPwd)
) then
if PremiButtonNoFrame('Entra') then
begin
fStato:=Autenticato;
fTimer.Enabled:=false;
result:=true;
if Assigned(FOnChangeState) then FOnChangeState(K_MSG03)
end;
end;
until ((fStato=TimeOutEd) or (fStato=Autenticato) or
(Application.Terminated ) );
end;
<html lang="it">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1 "/>
<LINK title="Sito WAI" rel="alternate" href="/wai/index.shtml" media="aural,
braille, tty"/>
<meta name="description" content="In questa pagina sono visualizzate le
liste di bollettini richieste. "/>
<meta name="keywords" content=""/>
<meta name="Author" content="Poste Italiane S.p.A."/>
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache"/>
<meta HTTP-EQUIV="Expires" CONTENT="-1"/><title>Poste Italiane - Bollettino
Report </title>
<SCRIPT LANGUAGE="JavaScript"
src="/bollettinoreport/posteBrnew.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript">write_style_tag()</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
function invia(idRichiesta){
document.cancellaRichiestaForm.idRichiesta.value=idRichiesta;
document.cancellaRichiestaForm.submit();
}
</SCRIPT>
</head><body bgcolor="#ffffff" leftmargin="0" topmargin="10" marginwidth="0"
marginheight="10" onLoad="setVariables();checkLocation()">
<table border="0" cellPadding=0 cellspacing="0" width="99%" summary="tabella
che contiene l'intestazione dell'appalicazione"><tr><td rowspan="2"
width="254"><a href="http://www.poste.it/" target="_top"><img
src="/bollettinoreport/img/tb/logo_posteitaliane.gif" alt="Home Poste
Italiane" width="254" height="42" border="0"></a></td><td align="left"
width="90%"><script language="JavaScript">visData();</script></td><td
align="right" width="90%" height="21"> </td></tr><tr
bgColor="#e8f404"><td> </td><td align="right"><img
src="/bollettinoreport/img/tb/fine.gif" alt="" width="25" height="21"
border="0"></td></tr><tr bgColor="#000099"><td> </td><td colspan="2"
align="right"><table border="0" cellPadding="4" cellspacing="0"
width="100%"><tr><td class=w10> </td></tr></table></td></tr></table>
<table border="0" cellpadding="0" cellspacing="0" width="99%"
height="72%"><tr valign="top"><td width="150"><div
style="width:150px;background-color:#ffffff;"> </div> </td><td
width="95%"> <br>
<table border="0" cellpadding="2" cellspacing="0" width="585"><tr
valign="top"><td width="585"><b class="blu12">Bollettino Report -
Esportazione risultati</b><br /><b>In questa pagina sono visualizzate le
liste di bollettini richieste.
</b><br></td>
</tr></table>
<form name="cancellaRichiestaForm" method="post"
action="/bollettinoreport/cancellaRichiesta.do">
<input type="hidden" name="idRichiesta" value="">
<div class="cornice">
<table cellspacing="1" summary="Ricerca bollettini accreditati">
<tr valign="top">
<th>ID</th>
<th>Descrizione</th>
<th>Data richiesta</th>
<th>Data scadenza</th>
<th>Data fine lavorazione</th>
<th>Numero immagini</th>
<th>Utente</th>
<th>Stato</th>
<th>Elimina</th>
</tr>
<tr valign="top">
<td align="right"><strong>
<a href='98422.zip?idRichiesta=98422'>
98422
</a>
</strong></td>
<td> </td>
<td>14/09/2006 14:19:40</td>
<td>14/09/2006 </td>
<td>14/09/2006 14:19:59</td>
<td align="right">218</td>
<td>consul</td>
<td>
<a href='98422.zip?idRichiesta=98422'><strong>disponibile</strong></a>
(scaduta)
</td>
<td align="center">
<a href="javascript:invia('98422')"><img
src="../bollettinoreport/img/ico/cancella.gif" border="0"></a>
</td>
</tr>
<tr valign="top">
<td align="right"><strong>
<a href='98337.zip?idRichiesta=98337'>
98337
</a>
</strong></td>
<td> </td>
<td>14/09/2006 13:05:40</td>
<td>14/09/2006 </td>
<td>14/09/2006 13:06:01</td>
<td align="right">401</td>
<td>consul</td>
<td>
<a href='98337.zip?idRichiesta=98337'><strong>scaricata</strong></a>
</td>
<td align="center">
<a href="javascript:invia('98337')"><img
src="../bollettinoreport/img/ico/cancella.gif" border="0"></a>
</td>
</tr>
<tr valign="top">
<td align="right"><strong>
<a href='98331.zip?idRichiesta=98331'>
98331
</a>
</strong></td>
<td> </td>
<td>14/09/2006 13:03:19</td>
<td>14/09/2006 </td>
<td>14/09/2006 13:03:54</td>
<td align="right">500</td>
<td>consul</td>
<td>
<a href='98331.zip?idRichiesta=98331'><strong>disponibile</strong></a>
(scaduta)
</td>
<td align="center">
<a href="javascript:invia('98331')"><img
src="../bollettinoreport/img/ico/cancella.gif" border="0"></a>
</td>
</tr>
---cut--