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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:06:10+00:00 2026-06-01T08:06:10+00:00

I have a webpage that has 3 file inputs. There are specific fields on

  • 0

I have a webpage that has 3 file inputs. There are specific fields on the form that needs to be sent when user uploads the file. I am not able to figure out how do i add custom data to my POST and how do i retrieve it back on the server. This is how my code looks like:

ASPX Page with 3 file inputs and other text boxes/dropdowns:

<form action="FilesUploader.ashx" method="post">

    <div id="dvNewAttachment1">
        <span>Attachment Type</span>
        <select id="ddlAttachmentType1">
            <option>T1</option>
            <option>T2</option>
            <option>T3</option>
        </select>
        <span>Description</span>
        <input id="txtDesc1" />
        <select id="ddlApproval1">
            <option>Yes</option>
            <option>No</option>
        </select>
        <input id="fileUploader1" type="file" runat="server" />
    </div>
    <br />
    ---------------
    <div id="dvNewAttachment2">
        <span>Attachment Type</span>
        <select id="ddlAttachmentType2">
            <option>T1</option>
            <option>T2</option>
            <option>T3</option>
        </select>
        <span>Description</span>
        <input id="txtDesc2" />
        <select id="ddlApproval2">
            <option>Yes</option>
            <option>No</option>
        </select>
        <input id="fileUploader2" type="file" runat="server" />
    </div>
    <br />
    -------------------------------
    <div id="dvNewAttachment3">
        <span>Attachment Type</span>
        <select id="ddlAttachmentType3">
            <option>T1</option>
            <option>T2</option>
            <option>T3</option>
        </select>
        <span>Description</span>
        <input id="txtDesc3" />
        <select id="ddlApproval3">
            <option>Yes</option>
            <option>No</option>
        </select>
        <input id="fileUploader3" type="file" runat="server" />
    </div>


<input type="submit" />

</form>

This is how my handler looks like:

public void ProcessRequest(HttpContext context)
        {

            HttpPostedFile myFile = context.Request.Files[0];

            int nFileLen = myFile.ContentLength;

            byte[] buffer = new byte[nFileLen];

            using (BinaryReader br = new BinaryReader(myFile.InputStream))
            {
                br.Read(buffer, 0, buffer.Length);
            }

        }

As you can see i have 3 uploads and each has Attachment Type and description associated with it which i need to retrieve for each input file in my handler.

Right now i am just processing file from the first input but later i am going to loop thru the inputs and process them.

  • 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-01T08:06:11+00:00Added an answer on June 1, 2026 at 8:06 am

    If your handler do not receive files that you place in file uploaders then your form needs to have additional attribute like this:

    <form action="FilesUploader.ashx" method="post" enctype="multipart/form-data">
    

    In order to get values from dropdowns on server you need to provide a name attribute to them:

    <select id="ddlApproval1" name="ddlApproval1">
        <option>Yes</option>
        <option>No</option>
    </select>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a webpage that has many user-generated elements that need to be cleaned
I will create a webpage that has a sidebar, and the sidebar will have
I have a webpage built with a dropdown that has a list of books.
I have a Google Map on the webpage with markers on it that has
You have a web page with a form that has an input field of
I have a webpage that has to be displayed in several different languages based
I have a webpage that has JavaScript in it. The script contains a method
I have a webpage which has an external javascript file attached to it .
I have a webpage that has a radio group as the options for the
have a webpage that has an image in it. in the CSS, i define

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.