how to read large block of text

Discussion in 'ASP General' started by coltrane, Jun 15, 2005.

  1. coltrane

    coltrane Guest

    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
    coltrane, Jun 15, 2005
    #1
    1. Advertising

  2. coltrane

    Roland Hall Guest

    "coltrane" wrote in message
    news:...
    :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
    Roland Hall, Jun 16, 2005
    #2
    1. Advertising

  3. coltrane

    coltrane Guest

    >>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
    coltrane, Jun 16, 2005
    #3
  4. coltrane

    Mark Schupp Guest

    What content type are you using?

    --
    --Mark Schupp


    "coltrane" <> wrote in message
    news:...
    >>>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
    >
    Mark Schupp, Jun 16, 2005
    #4
  5. coltrane

    coltrane Guest

    Mark,

    Text

    John
    coltrane, Jun 16, 2005
    #5
  6. coltrane

    Mark Schupp Guest

    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" <> wrote in message
    news:...
    > Mark,
    >
    > Text
    >
    > John
    >
    Mark Schupp, Jun 17, 2005
    #6
  7. coltrane

    coltrane Guest

    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" <> wrote in message
    > news:...
    > > Mark,
    > >
    > > Text
    > >
    > > John
    > >
    coltrane, Jun 17, 2005
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Showjumper
    Replies:
    1
    Views:
    700
    Showjumper
    Mar 19, 2005
  2. Noozer

    Block DIV within a block DIV?

    Noozer, Jan 6, 2005, in forum: HTML
    Replies:
    3
    Views:
    11,364
    Mitja
    Jan 6, 2005
  3. Andy
    Replies:
    0
    Views:
    531
  4. morrell
    Replies:
    1
    Views:
    947
    roy axenov
    Oct 10, 2006
  5. Alvin
    Replies:
    8
    Views:
    971
Loading...

Share This Page