By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,244 Members | 1,375 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,244 IT Pros & Developers. It's quick & easy.

Forms Using EncType = Multipart - Text Is Not Passed !

P: n/a
Dear Friends
Hope you all are doing great.

I am using a form to add text data to the database. With this form I
am also using a file field to upload a image file.

To use the first thing that is just data I dont have to write EncType
as it picks the default one. But to use the second one that is to
upload an image. I need to write EncType = "multipart/form-data". When
I do this the text passed from the other text field goes blank.

Why is it happening.

Is it that I cant get text data when I use
EncType="multipart/form-data".

Please help in solving this problem.

Love
Lovely

_________________________________________________

<tr>
<td width="100%" valign="top">
<form method="POST" action="data_save.asp"
EncType="multipart/form-data">
<div align="center">
<table border="0" cellpadding="0" cellspacing="0"
width="100%">
<tr>
<td width="100%" colspan="2">Add a new Main
Category</td>
</tr>
<tr>
<td width="20%">&nbsp;</td>
<td width="80%"></td>
</tr>
<tr>
<td width="20%">Name</td>
<td width="80%"><input type="text" name="name"
size="43"></td>
</tr>
<tr>
<td width="20%">Image</td>
<td width="80%"><input type="text"
name="image"></td>
</tr>
<tr>
<td width="20%">Description</td>
<td width="80%"><textarea rows="2"
name="description" cols="37"></textarea></td>
</tr>
</table>
</div>
<p align="center"><input type="submit" value="Submit"
name="B1"></p>
<input type="hidden" name="Category" value="0">
<input type="hidden" name="Choice" value="1">
</form>
</td>
</tr>
Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
lo******************@yahoo.com (Lovely Angel For You) wrote:
Is it that I cant get text data when I use
EncType="multipart/form-data".


Of course you can. Dealing with a text field is much easier than
processing the file field. But exactly how you do that depends on the
server-side technology used and is external to HTML.

HTML only defines how the data is sent - in this case, as a set of
documents inside a multipart message.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 20 '05 #2

P: n/a
lo******************@yahoo.com (Lovely Angel For You) wrote:
Dear Friends
Hope you all are doing great.

I am using a form to add text data to the database. With this form I
am also using a file field to upload a image file.

To use the first thing that is just data I dont have to write EncType
as it picks the default one. But to use the second one that is to
upload an image. I need to write EncType = "multipart/form-data". When
I do this the text passed from the other text field goes blank.

Why is it happening.


Because your server-side process (you didn't say what you're using)
conveniently sets Request.Form variables (or the equivalent) for you
if and only if you use the default enctype (as is the case in Active
Server Pages). Otherwise, you're on your own to parse them out of the
request.

--
Harlan Messinger
Remove the first dot from my e-mail address.
Veuillez ôter le premier point de mon adresse de courriel.
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.