PRB: XMLHTTP Send Method Raises Error When Large Files Are PUT (298108)



The information in this article applies to:

  • Microsoft XML 2.5
  • Microsoft XML 2.6
  • Microsoft XML 3.0
  • Microsoft XML 4.0
  • the operating system: Microsoft Windows 98

This article was previously published under Q298108

SYMPTOMS

When you use the send method of the IXMLHTTPRequest object to PUT a large file to a Web server, you receive the following error message:
Not enough storage available for the operation.
The error occurs on Windows 98 clients, but does not occur on Microsoft Windows 2000 clients. The more memory that a client has, the larger the file that can be sent.

CAUSE

Microsoft is currently investigating the cause of this error.

MORE INFORMATION

Steps to Reproduce Behavior

NOTE: Because the error occurs on Windows 98 clients that have limited memory, test on a Windows 98 system that has 16 to 32 megabytes (MB) of memory.
  1. Create a large document, such as a 60-MB bitmap, on the client.
  2. Create or select a virtual folder on your Web server where the client is to PUT the file.
  3. Grant write permissions for the virtual folder to the client.
  4. In Microsoft Visual Basic version 6.0, create a new Standard EXE project. Form1 is created by default.
  5. Add a command button to Form1.
  6. Paste the following code in the Click event of the command button:
    On Error GoTo ExitHandler 
    Dim LlFileLength As Long 
    Dim Lvarbin() As Byte 
    Dim LobjXML As Object 
    Dim LstrFileName As String 
    Dim LvarBinData As Variant 
    dim PstrFullfileName as string
    dim PstrTargetURL as string
    
    ' Create the XMLHTTP object and post the data to the server. 
    Set LobjXML = CreateObject("Microsoft.XMLHTTP") 
    PstrFullfileName = "C:\largefile.bmp"
    LlFileLength = FileLen(PstrFullfileName) - 1 
    
    ' Read the file into a byte array. 
    ReDim Lvarbin(LlFileLength) 
    Open PstrFullfileName For Binary As #1 
    Get #1, , Lvarbin 
    Close #1 
    
    ' Convert to variant to PUT. 
    LvarBinData = Lvarbin 
    PstrTargetURL = "Http://Servername/foldername"
    
    ' Put the data to the server, false means synchronous.
    LobjXML.Open "PUT", PstrTargetURL, False 
    
    ' Send the file in. 
    LobjXML.Send LvarBinData 
    Set LobjXML = Nothing 
    
    ExitHandler: 
    If (Err.Number <> 0) Then 
       MsgBox Err.Description 
    End If
    					
  7. Set PstrFullfileName as a valid file name on the client, and set PstrTargetURL as a valid URL.
  8. Run the project and click the command button.

Modification Type:MajorLast Reviewed:6/4/2003
Keywords:kbpending kbprb KB298108