473,386 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

how to read large block of text

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

Jul 22 '05 #1
6 2096
"coltrane" wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
: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
Jul 22 '05 #2
>>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

Jul 22 '05 #3
What content type are you using?

--
--Mark Schupp
"coltrane" <te*********@yahoo.com> wrote in message
news:11********************@g47g2000cwa.googlegrou ps.com...
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

Jul 22 '05 #4
Mark,

Text

John

Jul 22 '05 #5
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.

--
Mark Schupp

"coltrane" <te*********@yahoo.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
Mark,

Text

John

Jul 22 '05 #6
Thanks for your feedback.
Mark Schupp wrote:
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.

--
Mark Schupp

"coltrane" <te*********@yahoo.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
Mark,

Text

John


Jul 22 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Vinicius | last post by:
Hello, how to read an input text from keyboard (on a console) by the standard languace C, please? I really need a tip about this question. TIA, Vinicius.
1
by: J.S. | last post by:
I have a VB.Net Windows application that takes values inserted into textboxes in a windows form and inserts them into various parts of a large block of code. It concatenate the code blocks and the...
1
by: Saravanan | last post by:
I need to read in a text file as strings and then write some of these strings into another text file. The output file is in the working directory while the input text file is not. how can I...
1
by: Rajeev_nair_1981 | last post by:
I have written a program which executes an application (netview) and logs the output into a text file.Later I open and read this file line by line using getline() function.Now I need to check whether...
4
by: Karl | last post by:
How do you read a tab delimited text file? The file has 3 colums of data. I can read fixed width text files using the left and mid functions. I had rather not use transfer text and import specs.
9
by: junw2000 | last post by:
How to quickly read large C++ code with hundreds of classes, thousands of lines? Thanks. Jack
1
by: sherifffruitfly | last post by:
Hi, I get usage statistics emailed to me weekly, and would like to analyze the numbers. How can I read the body text of these emails into, say, a String instance? Thanks, cdj
6
by: arf | last post by:
Hello, i have a problem where i need read dataset from text file and keep them into a vector. e.g. dataset: "0012 0033 00045 0044 0047" Based on this dataset, i need to keep every 4...
3
by: clairePuj | last post by:
Hi everybody, Please can you tell me how can I read large data file (> 15 millions line) in C/C++ languge. Thanks for your help, Claire
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.