If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Out of Memory - Reading a 80MB file into memory in VB6

I'm getting a VB6 "Out of Memory" error when reading contents from a large file (80MB) into memory to be streamed to a web service using the Microsoft INet Control. The web service only accepts a single "POST" call from the VB6 application to process the entire contents of the file. Below is the code snippet that I am using. The line in red is where I get the "Out of Memory" error. It is happening with "TSO.Read(FileName.Size - 1)". Can anyone help me resolve this issue?

Re: Out of Memory - Reading a 80MB file into memory in VB6

I'd think you'd be better off reading the file in chunks, and feeding the data to your upload routine as the server takes it. Not sure if the inet control would be the most appropriate for that though.

Please remember to rate the posts and threads that you find useful.How can something be both new and improved at the same time?

Re: Out of Memory - Reading a 80MB file into memory in VB6

If the web service only accepts a single POST command, splitting up is not an option.
I'd first see what is causing the problem:
Split up the troublesome line into two seperate commands. First read the file into a string variable

Re: Out of Memory - Reading a 80MB file into memory in VB6

If the web service only accepts a single POST command, splitting up is not an option.

While it is true that there'd only be a single POST command, there would be many packets of data for a file of the size in question.

The Winsock control has a SendProgress event. I'd think this could be used to collect additional chucks of data from the file to be sent. I've not used the inet control, so I don't know if it offers something of this sort.

The POST command includes the total length of the data being sent, so the server would be expecting more if only part of it were sent. It's been awhile since I had to deal with this, so I'd probably use a packet sniffer to see what handshaking goes on between client and server during an upload.

Please remember to rate the posts and threads that you find useful.How can something be both new and improved at the same time?

* The Perfect Platform for Game Developers: Android
Developing rich, high performance Android games from the ground up is a daunting task. Intel has provided Android developers with a number of tools that can be leveraged by Android game developers.

* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.