Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8363187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:07:04+00:00 2026-06-09T12:07:04+00:00

The JavaScript for the POST is file = document.getElementById(upfName).files[0]; xhrObj = new XMLHttpRequest(); xhrObj.open(POST,

  • 0

The JavaScript for the POST is

file = document.getElementById("upfName").files[0];
xhrObj = new XMLHttpRequest();
xhrObj.open("POST", llm.serverExe + '?dataUpload', true);
xhrObj.setRequestHeader("Content-type", file.type);
xhrObj.setRequestHeader("X_FILE_NAME", file.name);
xhrObj.send(file);

The cgi side in C++ is

int iLen = atoi(getenv("HTTP_CONTENT_LENGTH"));
char* pBuff = <<allocates iLen bytes>>
read(0, pBuff, iLen);

If I send about 100k of text (about 10k short lines), iLen is correct but there is only about 10k of data and the last part of it is garbled (after about 1000 lines it starts showing at about line 900 again, shows 100 lines and then 90k of nothing)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T12:07:06+00:00Added an answer on June 9, 2026 at 12:07 pm

    It was a stupid attack.

    1) You need to read in a loop to get all of the data, the read with return with ‘partial’ data.

    2) You need to change the file mode of stdin to binary on windows for the count to be correct if the data is text. Otherwise the read removes carrage-returns making the data size smaller. Then since there is less data than you expect, the read will eventually just not return (stdin will not return an EOF, it just hangs).

    All better now.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an index.php file that loads other php files via this javascript/ajax code:
Possible Duplicate: JavaScript post request like a form submit I have a value calculated
i have the following javascript to post a form through ajax without refreshing the
I have the following javascript: $.post(/Authenticated/DeletePage/ + PageId); showStatus(Page deleted..., 10000); I would like
I'm trying to post a JavaScript data object with the following: $.post(frm.attr(action), data, function(res)
I have been using the Facebook Javascript SDK to post content from a CMS
Can anyone post a sample code wherein theres a running timer(javascript settimeout) and doing
I want to post some data via javascript to another domain. Something like: http://www.othersite.com/submitfunnyname?name=blah
Original Post: I am trying to use the Client-side Authentication with the Javascript SDK
Using JavaScript SDK, it is possible to wall post with user's consent. Since It

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.