Re: Problem when using multipart/form-data post

  •  06-14-2004, 10:29 PM

    Re: Problem when using multipart/form-data post

    Hi Pedro,
     
    If you have a form as follows:

    <form action="xyz.asp" method="post" enctype="multipart/form-data">

    <input type="file" name="FILE1" size="30">

    <input type="text" name="def" value="0" size="10">

    etc.....
    You can't get the your asp page to recognize data in other form input boxes using Request.Form.
     
    Here is the reason:
     
    <INPUT NAME="your_picture" TYPE=FILE>
     
    This type of control presents the client with a text field, and a "Browse" button that allows them to select a file on their system.
     
    In order to use file-selection controls, you must set the ENCTYPE attribute of the <form> tag to "multipart/form-data" and the <form> tag's METHOD attribute to "post". 
     
     By setting the enctype attribute of the <form> tag to "multipart/form-data", you will not be able to use Request.Form to retrieve the values of the form fields.
     
    You will have to write server-side code using Request.BinaryRead to read the contents of the http request, after which you will have to parse through this information and manually extract the desired field values.
     
     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

View Complete Thread