AttachmentDropTarget ActiveX Control

Introduction

The AttachmentDropTarget ActiveX control supports dragging attachments from Outlook and Outlook Express mail clients and Windows explorer onto a Web page.

Demonstration

To test the control, open Outlook and drag mail attachments onto the drop target shown below. The attachments’ file names and contents will be shown on this page. It is recommended to use this test page with attachments in text format only because the JavaScript converts the returned data to text.

Quick Reference

The FileAdded event is raised for each file dropped onto the control. Each occurance of the event is followed by one or more occurances of the DataArrived event. The Data parameter of the DataArrived event contains blocks of data belonging to the file the FileAdded event raised before. The last block can be determined by comparing the length of the retrieved block to the value of the BlockSize property. If the length of the retrieved block is smaller than this value, no additional blocks follow and the file transfer is complete. The block size can be adjusted by setting the BlockSize property to an appropriate value.

Setup

The control can be used inside the Internet Explorer Web browser. The following guide is based on Internet Explorer 6.0 SP2. To install the control, navigate the browser to a Web page containing the control. Add the page to the “Trusted Sites” zone and refresh it. Then choose “Install” from the dialog which appears directly after the refresh. After doing so the control can be used. The control can be removed via %WINDIR%\Downloaded Program Files.

Further Development


Copyright © 2006 Herfried K. Wagner. All Rights Reserved.