Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved.
Terms
of Use |
Trademarks
Article ID: 298108 - Last Review: February 12, 2007 - Revision: 2.1
PRB: XMLHTTP Send Method Raises Error When Large Files Are PUT
This article was previously published under Q298108
On This Page
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.
- Create a large document, such as a 60-MB bitmap, on the client.
- Create or select a virtual folder on your Web server where the client is to PUT the file.
- Grant write permissions for the virtual folder to the client.
- In Microsoft Visual Basic version 6.0, create a new Standard EXE project. Form1 is created by default.
- Add a command button to Form1.
- 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
- Set PstrFullfileName as a valid file name on the client, and set PstrTargetURL as a valid URL.
- Run the project and click the command button.
APPLIES TO
- Microsoft XML Parser 2.5
- Microsoft XML Parser 2.6
- Microsoft XML Parser 3.0
- Microsoft XML Core Services 4.0
- Microsoft Windows 98 Standard Edition
Community Feedback System
Very often, it takes hours to solve a problem. Very often, you've looked high
and low, and have tried a lot of solutions. When you finally found it, chances
are, it was because someone else helped you. Here's your chance to give back.
Use our community feedback tool to let others know what worked for you and what
didn't.
Please also understand that the community feedback system is not warranted to be
correct, it's simply a system that we've built to let people try and help each
other. If something in a feedback response doesn't make sense to you, or you're
not comfortable making changes that the feedback talks about (like registry
edits), please consult a professional.
Thank you for using kbAlertz.com Feedback System.
-- Scott Cate
Be the first to leave feedback, to help others about this knowledge base
article.
(Optional) Name
(Optional)
Public URL Or Email
Comments
No
HTML -- Text Only Please