Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CHttpFile->WriteString

CHttpFile->WriteString

Scheduled Pinned Locked Moved C / C++ / MFC
sysadminquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    aman2006
    wrote on last edited by
    #1

    Hi I have one CString strData with data and i want to send it on to the server in Chunk of 500 Bytes only.Please tell me how can i do that. Right now i am sending it as whole. here is the code strData = _T("Data=") + URLEncode2(strData); pHttpFile->AddRequestHeaders(strHeaders); pHttpFile->SendRequestEx(strData.GetLength()); pHttpFile->WriteString(strData); Thanks Shailesh

    D 1 Reply Last reply
    0
    • A aman2006

      Hi I have one CString strData with data and i want to send it on to the server in Chunk of 500 Bytes only.Please tell me how can i do that. Right now i am sending it as whole. here is the code strData = _T("Data=") + URLEncode2(strData); pHttpFile->AddRequestHeaders(strHeaders); pHttpFile->SendRequestEx(strData.GetLength()); pHttpFile->WriteString(strData); Thanks Shailesh

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      Why not use something like:

      int x = 0;
      do
      {
      CString strSend = strData.Mid(x, 500);
      x = x + 500;
      // send it now
      } while (! strSend.IsEmpty());


      "One must learn from the bite of the fire to leave it alone." - Native American Proverb

      A 1 Reply Last reply
      0
      • D David Crow

        Why not use something like:

        int x = 0;
        do
        {
        CString strSend = strData.Mid(x, 500);
        x = x + 500;
        // send it now
        } while (! strSend.IsEmpty());


        "One must learn from the bite of the fire to leave it alone." - Native American Proverb

        A Offline
        A Offline
        aman2006
        wrote on last edited by
        #3

        While going into loop it throws the exception at strSend = strData.Mid(x,500) after going into loop 2 or 3 times . May be it is reached at the end of strData. Any Suggestion Thanks Shailesh

        D 1 Reply Last reply
        0
        • A aman2006

          While going into loop it throws the exception at strSend = strData.Mid(x,500) after going into loop 2 or 3 times . May be it is reached at the end of strData. Any Suggestion Thanks Shailesh

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          Stepping into the call to CString::Mid() that asserts would have revealed the problem (hopefully). If the length of the string at point x is less than 500, ...


          "One must learn from the bite of the fire to leave it alone." - Native American Proverb

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups