Leaked source code of windows server 2003
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

  1. <HTML>
  2. <HEAD>
  3. <META NAME="GENERATOR" Content="Microsoft Developer Studio">
  4. <META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
  5. <OBJECT ID=pchealth classid=CLSID:FC7D9E02-3F9E-11d3-93C0-00C04F72DAF7></OBJECT>
  6. <TITLE>Document Title</TITLE>
  7. </HEAD>
  8. <BODY>
  9. <SCRIPT LANGUAGE=javascript>
  10. <!--
  11. var UL_NOTACTIVE = 0x00000000; // Status before first Activate() call.
  12. var UL_ACTIVE = 0x00000001; // Status after Activate() call.
  13. var UL_SUSPENDED = 0x00000002; // Status after Suspend() call.
  14. var UL_TRANSMITTING = 0x00000003; // Status while actually transmitted.
  15. var UL_ABORTED = 0x00000004; // Status after a temporary failure (no connection, etc.)
  16. var UL_FAILED = 0x00000005; // Status after a permanent failure (server deny, ect.)
  17. var UL_COMPLETED = 0x00000006; // Status after successful transmission.
  18. var UL_DELETED = 0x00000007; // status after deletion.
  19. var UL_MODE_BACKGROUND = 0x00000000;
  20. var UL_MODE_FOREGROUND = 0x00000001;
  21. var g_ul = null;
  22. var g_job = null;
  23. function ul_onStatusChange( job, status )
  24. {
  25. Print( "onStatusChange " + status );
  26. Print( "Change = " + job.Status );
  27. // if(status == UL_FAILED ||
  28. // status == UL_COMPLETED ||
  29. // status == UL_DELETED )
  30. // {
  31. // g_job = null;
  32. // }
  33. }
  34. function ul_onProgressChange( job, lDone, lTotal )
  35. {
  36. Print( "onProgress " + lDone + " " + lTotal );
  37. Print( "Change = " + job.Status );
  38. }
  39. /////////////////////////////////////////////////////////////////////////////
  40. function Print( line )
  41. {
  42. out.innerHTML = out.innerHTML + line + "<BR>";
  43. }
  44. function Clear()
  45. {
  46. out.innerHTML = "";
  47. }
  48. function button_exec()
  49. {
  50. Clear();
  51. g_ul = new ActiveXObject( "UploadManager.MPCUpload" );
  52. for(var e = new Enumerator( g_ul ); !e.atEnd(); e.moveNext())
  53. {
  54. var job = e.item();
  55. job.Delete();
  56. }
  57. g_job = g_ul.CreateJob();
  58. g_job.Sig = ""; // Generate ID automatically.
  59. g_job.Server = "http://dmassare2/pchealth/uploadserver.dll";
  60. g_job.ProviderID = "Esc";
  61. g_job.Mode = UL_MODE_BACKGROUND;
  62. g_job.Mode = UL_MODE_FOREGROUND;
  63. g_job.History = 2; // 2 = Keep Log and Data
  64. g_job.Compressed = true;
  65. g_job.PersistToDisk = true;
  66. g_job.GetDataFromFile( idFile1.value );
  67. g_job.onStatusChange = ul_onStatusChange;
  68. g_job.onProgressChange = ul_onProgressChange;
  69. g_job.ActivateAsync();
  70. }
  71. function button_abort()
  72. {
  73. if(g_job != null)
  74. {
  75. g_job.Delete();
  76. }
  77. }
  78. ////////////////////
  79. function button_getdata()
  80. {
  81. if(g_job)
  82. {
  83. g_job.PutDataIntoFile( idFile2.value );
  84. }
  85. }
  86. function button_getresp()
  87. {
  88. if(g_job)
  89. {
  90. var stream = g_job.GetResponseAsStream();
  91. }
  92. }
  93. //-->
  94. </SCRIPT>
  95. <INPUT type="file" id="idFile1">&nbsp;
  96. <INPUT type="button" value="Start Upload" onClick="button_exec();">&nbsp;
  97. <INPUT type="button" value="Abort" onClick="button_abort();"><BR><P>
  98. <INPUT type="file" id="idFile2">&nbsp;
  99. <INPUT type="button" value="Get Data" onClick="button_getdata();">&nbsp;
  100. <INPUT type="button" value="Get Response" onClick="button_getresp();"><BR><P>
  101. <DIV ID=out></DIV>
  102. </BODY>
  103. </HTML>