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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:56:14+00:00 2026-05-25T19:56:14+00:00

If I set up an HTML page with the following form: <html> <body> <form

  • 0

If I set up an HTML page with the following form:

<html>

    <body>
        <form action="upload_file.php"
              method="post"
              enctype="multipart/form-data">

            <label for="file">Filename:</label>
            <input type="file" name="file" id="file" />
            <br />
            <input type="submit" name="submit" value="Submit" />
        </form>
    </body>

</html>

I can upload a file to upload_file.php where I can handle it using a PHP script.

For testing purposes, I need to do the same using raw HTTP via a PuTTY session.

I can do a normal POST (just sending text data) this way:

POST /test_post.php HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 11

name=myname

How can I send a file this way?

  • 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-05-25T19:56:14+00:00Added an answer on May 25, 2026 at 7:56 pm

    You have to use multipart content-type and encode the file data into hex/binary

    Try the following in telnet:

    POST /the_url HTTP/1.1
    User-Agent: Mozilla
    Host: www.example.com
    Content-Length: xxxx
    Content-Type: multipart/form-data; boundary=--------------------31063722920652
    ------------------------------31063722920652
    Content-Disposition: form-data; name="a"
    
    value_for_a
    ------------------------------31063722920652
    Content-Disposition: form-data; name="b"
    
    value_for_b
    ------------------------------31063722920652
    Content-Disposition: form-data; name="c"; filename="myfile.txt"
    Content-Type: text/plain
    
                This is a test 
                and more
    
    -----------------------------31063722920652
    Content-Disposition: form-data; name="submit"
    
    Submit
    -----------------------------31063722920652--
    

    Remember that an extra newline is necessary between field name and its data. Also, update the Content-Length value.

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

Sidebar

Related Questions

I have a page, test.php, with the following code: <html> <body> <form> <script type=text/javascript>
I have a PHP page that returns a piece of HTML to set the
I have the following form in cakephp: <div class=quickcontactDisplay> <?php echo $form->create('Enquiry',array('action'=>'add','class'=>'quickcontact')); echo $form->hidden('visitor_id',
Is it possible to set the cursor to 'wait' on the entire html page
I have a page with some HTML in it. and I need to set
If I put a form control on the page with a value already set,
I have noticed the following with my page thePage.php. My page thePage.php has a
I am submitting from a form to another php page which is supposed to
What changes do I have to make to the following simple HTML page to
Given the following html: <body> <div style=float: left; background: red>Hi</div> <div style=float: left; background:

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.