how to read large block of text

C

coltrane

I am trying to create an ASP page that processes a large block of text
that is posted to the page. The data block is approximately 500K. The
only was I can figure to get the posted text into a string is using
BinaryToString. Is there another way to just get the body of text that
is posted?

thanks for your help

john
 
R

Roland Hall

in message
:I am trying to create an ASP page that processes a large block of text
: that is posted to the page. The data block is approximately 500K. The
: only was I can figure to get the posted text into a string is using
: BinaryToString. Is there another way to just get the body of text that
: is posted?

Is it posted via the URL or in the header? I don't think there is much a
limit if posted in the header.

I wrote a VBS script to upload a file to ASP passing the name of the file,
which actually gets is using FSO and submits it as text in a textarea. The
only thing I've had to consider for large files is a timeout.

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
 
C

coltrane

Is it posted via the URL or in the header?

This is a good question. I am using IWinHttpRequest object from the
WinHttp SDK. This performs IHttpRequest->Open specifying POST. The data
is then sent using IHttpRequest->Send. The data is sent as a block of
text without any "?valuename=".
Unfortunately, this is a mix of an ASP scripting question and a
HTTPRequest COM question. argh!

I guess I can try to "sniff" the http packets.

for giggles I'll include a chunk of the C++ code:

bsUrl = "www.test.com"

pHttp.CoCreateInstance( __uuidof(WinHttpRequest) );
_variant_t vEmpty;
pHttp->SetProxy( HTTPREQUEST_PROXYSETTING_PRECONFIG, vEmpty, vEmpty );

hr = pHttp->Open( HTTP_VERB_POST, bsUrl, _variant_t(true) );

pHttp->put_Option( WinHttpRequestOption_EnableRedirects,
_variant_t(bHandleRedirect) );

pHttp->SetRequestHeader(L"Content-length", _bstr_t(szLength) );
pHttp->SetRequestHeader(L"Content-type", bsContentType);

m_pHttp->Send( vData );

Thanks for the feedback


John
 
M

Mark Schupp

For data to appear in the form collection it should have a content type of
"application/x-www-form-urlencoded" and be in name/value format.

Try using that content type and pre-pending a "mydata=" to the data
(urlencode the data first). See if that works the way you expect for small
amounts of data. Then try a large chunk of data to see if this does what you
need. There may be some settings that you will have to change on the
web-server for large data posts (IIRC IIS6 restricts posts to 200k by
default).

Also, include your original problem in future posts. I don't remember
exactly what you were trying to do.
 
C

coltrane

Thanks for your feedback.


Mark said:
For data to appear in the form collection it should have a content type of
"application/x-www-form-urlencoded" and be in name/value format.

Try using that content type and pre-pending a "mydata=" to the data
(urlencode the data first). See if that works the way you expect for small
amounts of data. Then try a large chunk of data to see if this does what you
need. There may be some settings that you will have to change on the
web-server for large data posts (IIRC IIS6 restricts posts to 200k by
default).

Also, include your original problem in future posts. I don't remember
exactly what you were trying to do.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top