You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
133 lines
3.2 KiB
133 lines
3.2 KiB
<HTML>
|
|
<HEAD>
|
|
<META NAME="GENERATOR" Content="Microsoft Developer Studio">
|
|
<META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
|
|
<OBJECT ID=pchealth classid=CLSID:FC7D9E02-3F9E-11d3-93C0-00C04F72DAF7></OBJECT>
|
|
<TITLE>Document Title</TITLE>
|
|
</HEAD>
|
|
|
|
<BODY>
|
|
<SCRIPT LANGUAGE=javascript>
|
|
<!--
|
|
|
|
var UL_NOTACTIVE = 0x00000000; // Status before first Activate() call.
|
|
var UL_ACTIVE = 0x00000001; // Status after Activate() call.
|
|
var UL_SUSPENDED = 0x00000002; // Status after Suspend() call.
|
|
var UL_TRANSMITTING = 0x00000003; // Status while actually transmitted.
|
|
var UL_ABORTED = 0x00000004; // Status after a temporary failure (no connection, etc.)
|
|
var UL_FAILED = 0x00000005; // Status after a permanent failure (server deny, ect.)
|
|
var UL_COMPLETED = 0x00000006; // Status after successful transmission.
|
|
var UL_DELETED = 0x00000007; // status after deletion.
|
|
|
|
var UL_MODE_BACKGROUND = 0x00000000;
|
|
var UL_MODE_FOREGROUND = 0x00000001;
|
|
|
|
var g_ul = null;
|
|
var g_job = null;
|
|
|
|
function ul_onStatusChange( job, status )
|
|
{
|
|
Print( "onStatusChange " + status );
|
|
Print( "Change = " + job.Status );
|
|
|
|
// if(status == UL_FAILED ||
|
|
// status == UL_COMPLETED ||
|
|
// status == UL_DELETED )
|
|
// {
|
|
// g_job = null;
|
|
// }
|
|
}
|
|
|
|
function ul_onProgressChange( job, lDone, lTotal )
|
|
{
|
|
Print( "onProgress " + lDone + " " + lTotal );
|
|
Print( "Change = " + job.Status );
|
|
}
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
function Print( line )
|
|
{
|
|
out.innerHTML = out.innerHTML + line + "<BR>";
|
|
}
|
|
|
|
function Clear()
|
|
{
|
|
out.innerHTML = "";
|
|
}
|
|
|
|
|
|
function button_exec()
|
|
{
|
|
Clear();
|
|
|
|
g_ul = new ActiveXObject( "UploadManager.MPCUpload" );
|
|
|
|
for(var e = new Enumerator( g_ul ); !e.atEnd(); e.moveNext())
|
|
{
|
|
var job = e.item();
|
|
|
|
job.Delete();
|
|
}
|
|
|
|
|
|
g_job = g_ul.CreateJob();
|
|
|
|
g_job.Sig = ""; // Generate ID automatically.
|
|
g_job.Server = "http://dmassare2/pchealth/uploadserver.dll";
|
|
g_job.ProviderID = "Esc";
|
|
g_job.Mode = UL_MODE_BACKGROUND;
|
|
g_job.Mode = UL_MODE_FOREGROUND;
|
|
g_job.History = 2; // 2 = Keep Log and Data
|
|
g_job.Compressed = true;
|
|
g_job.PersistToDisk = true;
|
|
g_job.GetDataFromFile( idFile1.value );
|
|
|
|
g_job.onStatusChange = ul_onStatusChange;
|
|
g_job.onProgressChange = ul_onProgressChange;
|
|
|
|
g_job.ActivateAsync();
|
|
}
|
|
|
|
function button_abort()
|
|
{
|
|
if(g_job != null)
|
|
{
|
|
g_job.Delete();
|
|
}
|
|
}
|
|
|
|
////////////////////
|
|
|
|
function button_getdata()
|
|
{
|
|
if(g_job)
|
|
{
|
|
g_job.PutDataIntoFile( idFile2.value );
|
|
}
|
|
}
|
|
|
|
function button_getresp()
|
|
{
|
|
if(g_job)
|
|
{
|
|
var stream = g_job.GetResponseAsStream();
|
|
}
|
|
}
|
|
|
|
//-->
|
|
</SCRIPT>
|
|
|
|
<INPUT type="file" id="idFile1">
|
|
<INPUT type="button" value="Start Upload" onClick="button_exec();">
|
|
<INPUT type="button" value="Abort" onClick="button_abort();"><BR><P>
|
|
|
|
<INPUT type="file" id="idFile2">
|
|
<INPUT type="button" value="Get Data" onClick="button_getdata();">
|
|
<INPUT type="button" value="Get Response" onClick="button_getresp();"><BR><P>
|
|
|
|
<DIV ID=out></DIV>
|
|
|
|
|
|
</BODY>
|
|
</HTML>
|