html_code_clinic thread: Re: form fields are emtpy when I include enctype="multipart/form-data"
When you post form-data, the info is transmitted completely differently,
which is why you can't read it using Request.Form. I assume you're trying
to retrieve a file from a user's machine, using, probably, a Browse button.
While it is possible to use a free Microsoft component to read the
uploaded data (have a search on their site), it's sometimes fiddly. There
are loads of freeware or shareware programs out there that will help, but
if you've got a budget, I'd recommend Infomentum's ActiveFile. We use it
in conjunction with AppletFile, which lets you upload many files and even
folders at once. www.infomentum.com (That's not an advert, we're a genuine
customer of theirs.)
Cheers,
Steve
> Hi,
>
>
> I have a very simple form.
>
> when I do not include enctype="multipart/form-data" then it works
> perfectly.
>
>
> However when I replace the following ...
>
> <form action="test1.asp" method="post">
>
>
>
> with...
>
>
>
> <form action="test1.asp" method="post" enctype="multipart/form-data">
>
>
>
> then I get empty form fields, i.e the values are all null? Also if I use
> the "get" method rather than "post" then it works fine?
>
>
> TIA
>
> Dave
>
> My html is below;
>
>
>
>
> <html>
> <head>
>
>
>
> </head>
>
> <body bgcolor="#FFFFFF" onLoad="" leftmargin="0" topmargin="0"
> marginwidth="0" marginheight="0">
> <b>Test 1;</b><br><br>
> <form action="test1.asp" method="post" enctype="multipart/form-data">
> <table width="75%" border="1">
> <tr>
> <td width="23%">First Name:</td>
> <td width="44%">
> <input type="text" name="firstName">
> </td>
> </tr>
> <tr>
> <td width="23%">Second Name:</td>
> <td width="44%">
> <input type="text" name="secondName">
> </td>
> </tr>
> <tr>
> <td width="23%">Job Title:</td>
> <td width="44%">
> <input type="text" name="jobTitle">
> </td>
> </tr>
> <tr>
> <td width="23%"> </td>
> <td width="44%">
> <input type="submit" name="Submit" value="Submit">
> </td>
> </tr>
> </table>
> </form>
> </BODY>
> </HTML>