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 8654683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:50:52+00:00 2026-06-12T14:50:52+00:00

for the file upload should be modify, so I try to combine the upload

  • 0

for the file upload should be modify, so I try to combine the upload string by hand:

    function submitdata(){
        //var data = new FormData();
        var sb="";
        var BOUNDARY = "-------------------------4827543632391";

        sb+="--"+BOUNDARY;
        sb+="\r\n";
        sb+="Content-Disposition: form-data; name=\"fileinput\"    filename=\"004.jpg\" \r\n";
        sb+="Content-Type: image/jpeg\r\n\r\n";
        .....
        var reader = new FileReader();
            reader.readAsBinaryString(data);
        //fd.append("blob", sb);
        reader.onload = function(e){
            sb+=this.result;
            sb+="\r\n--" + BOUNDARY + "--\r\n";

            var datasubmit="Content-Type:multipart/form-data; boundary="+BOUNDARY+"\n";
            datasubmit+="Content-Length: "+eval(sb.length)+ "\r\n\r\n";
            var xhr = new XMLHttpRequest();
            xhr.open("POST", "addimages");
            xhr.setRequestHeader("Content-Type", "multipart/form-data");
            xhr.overrideMimeType('multipart/form-data');
            xhr.sendAsBinary(datasubmit+sb);

           }


    }

every time the submit data body is:

Content-Type:multipart/form-data; boundary=-------------------------4827543632391
Content-Length: 283111

I want to put above part to heard not body!!!

---------------------------4827543632391 
Content-Disposition: form-data; name="fileinput" filename="004.jpg" 
Content-Type: image/jpeg 


ÿØÿà�JFIF������ÿÛ�C�  %# , #&')*)-0-(0%()(ÿÛ�C   (((((((((((((((((((((((((((((((((((((((((((((((((((ÿÀ�@m"�ÿÄ����������� ÿÄ�µ���}�!1AQa"q2¡#B±ÁRÑð$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖרÙÚáâãäåæçèéêñòóôõö÷øùúÿÄ�������� ÿÄ�µ��w�!1AQaq"2B¡±Á #3RðbrÑ $4á%ñ&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz....

what I want is:

Request Headers From Upload Stream
Content-Length: 283122
Content-Type: multipart/form-data;boundary=---------------------------23281168279961

I just do not know my

Content-Type:multipart/form-data; …… to the header part of the Stream Form

can anyone give me an example of http package with “Content-Type:multipart/form-data;..” with the head? Or tell me how to write java-script to put the Content-Type: to head part.
I tried xhr.setRequestHeader(), it write the httphearder but not the Upload Stream header.

  • 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-12T14:50:53+00:00Added an answer on June 12, 2026 at 2:50 pm

    I may be misunderstanding, but you need to create new headers the xhr.setRequestHeader() method call.

    As you’re doing it (and seeing) you’re just prepending material to the body. The setRequestHeader() method (taking the header name and content as two arguments) will create new headers to be sent. Note that you can create as many headers as you need by calling the method multiple times.

    Hope this helps.

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

Sidebar

Related Questions

When I try to process file upload, should I run verification based on file
All Gmail users should have already noticed that file upload progress bar has been
Hallo I want to make an file upload. The script should take the image,
i want to upload the sound file (.ogg) in server. But it should write
I have created a helper that requires some parameters and should upload a file,
I want to create a simple file upload server. The server should be able
I have a simple file upload form where a user should be able to
I have a file upload function in my asp.net mvc application that allows users
Which file we should upload to server .scss or .css when we use Sass?
The plugin should allow delete the uploaded file and multiple file upload. EDIT: Actually

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.