FIX: Inline Data For OBJECT Tag DATA Attribute Limited to 4K (201515)



The information in this article applies to:

  • Microsoft Internet Explorer (Programming) 4.01 SP1
  • Microsoft Internet Explorer (Programming) 5_beta

This article was previously published under Q201515

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 that this is a bug in the Microsoft products that are 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 about developing Web-based solutions for Microsoft Internet Explorer, visit the following Microsoft Web sites:


Modification Type:MajorLast Reviewed:5/11/2006
Keywords:kbbug kbCtrl kbCtrlCreate kbDHTML kbfix kbhtml kbie500fix kbInetDev KB201515