FIX: Inline Data For <OBJECT> Tag DATA Attribute Limited to 4K

ID: Q201515


The information in this article applies to:


SYMPTOMS

When instantiating an ActiveX control or other <OBJECT> on a Web page, Internet Explorer 4.01 SP1 will pass only 4K of inline data to the object.

This problem is typically encountered when editing an HTML page that contains an ActiveX control with an HTML editor that saves the properties of the control as inline data, rather than as property bag <PARAM> tags.


RESOLUTION

Place the data into a separate file and refer the DATA attribute to the URL of that file.


STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug was corrected in Microsoft Internet Explorer 5.


MORE INFORMATION

ActiveX controls are placed on a Web page using the HTML <OBJECT> tag. In addition, data can be passed to the control by specifying inline data in the DATA attribute. This inline data can take the form of MIME64 encoded data or a URL that refers to a data file to be downloaded asynchronously. Internet Explorer uses the control's implementation of IPersistStreamInit to pass this data to the control.

The following HTML demonstrates using the DATA attribute to pass inline data to an ActiveX control:


<OBJECT ID="myCtrl" WIDTH=50 HEIGHT=50
 CLASSID="CLSID:nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn"
 DATA="DATA:application/x-oleobject;BASE64,j43aWGqdGxCvwEIQECqNpy
           FDNBIIAAAA7QMAAO0DAACAfuHmAgAFADEAAAAQ">
</OBJECT> 

If you require more than 4K of data to be passed to an ActiveX control, you can place this data into a file and refer to this using a URL. The data file will be downloaded by Internet Explorer, placed in an OLE stream and passed to the control using it's implementation of IPersistStreamInit::Load(). The data file can contain data in whatever format the control recognizes--the control will receive this data unchanged.

The following HTML demonstrates using the DATA attribute to pass an asynchronously downloaded file to an ActiveX control:


<OBJECT ID="myCtrl2" WIDTH=50 HEIGHT=50
    CLASSID="CLSID:nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn"
    DATA="http://server/myfile.dat"><BR/>
</OBJECT> 


REFERENCES

For more information, please see the MSDN Web Workshop:

http://msdn.microsoft.com/workshop/default.asp


© Microsoft Corporation 1999, All Rights Reserved.
Contributions by Mark Davis, Microsoft Corporation

Additional query words: asynchronous download Visual Interdev ActiveX Control Pad ImageList


Keywords          : kbhtml kbActiveX kbCtrl kbCtrlCreate kbDHTML kbInternet kbIE401sp1 kbIE500dp1 kbIE500fix kbInetDev 
Version           : WINDOWS:4.01 SP1,5.0dp1,5_beta
Platform          : WINDOWS 
Issue type        : kbbug 

Last Reviewed: April 9, 1999