Problem when using multipart/form-data post

Last post 06-14-2004, 10:29 PM by Adam. 1 replies.
Sort Posts: Previous Next
  •  06-13-2004, 8:12 PM 1006

    Problem when using multipart/form-data post

    Hi,

     
    Got a situation with your asp version of cuteeditor, i'm really happy with the .net version but the asp version as a little problem if we use a form with a file field, a cuteeditor, we are forced to use a multipart/form-data post to retrive the file from the file input, but that causes the html editor to not post anything..
     
     
    any fix for this situation?
     
    Regards,
     
    Pedro Costa
  •  06-14-2004, 10:29 PM 1020 in reply to 1006

    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 as RSS news feed in XML