473,395 Members | 1,393 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Form and enctype.

Hi.

I found out that when one creates form which should upload files one
needs to use: enctype="multipart/form-data"

In other cases one needs to use:
enctype="application/x-www-form-urlencoded"

However, what is still not clear to me is what value for enctype I need
to use if I want to create form which should both contains text fields
and form for files uploading.

To empirically find an answer on my question, I have created form which
contains only text fields and put there
enctype="application/x-www-form-urlencoded".

I found no differences from form with default value for anctype. Even
if I put special symbols in text fields (such as &, %, ?, and so on).

What bad can happen with the usage of text fields in combination with
enctype="application/x-www-form-urlencoded"?

Jan 14 '06 #1
9 2470
op*********@yahoo.com wrote:
I found out that when one creates form which should upload files one
needs to use: enctype="multipart/form-data"
Right.
In other cases one needs to use:
enctype="application/x-www-form-urlencoded"
No, you don't. First, it's the default, so it need not be specified
explicitly. Second, enctype="multipart/form-data" can be used even if there
is no file input field. It's just about the format of encoding form data.
However, what is still not clear to me is what value for enctype I need
to use if I want to create form which should both contains text fields
and form for files uploading.
You need to use enctype="multipart/form-data", as the spec says.
To empirically find an answer on my question,
Why? Your tests will be limited anyway. Why not check the specs first?
I have created form which
contains only text fields and put there
enctype="application/x-www-form-urlencoded".

I found no differences from form with default value for anctype.


That's because the default _is_ "application/x-www-form-urlencoded".

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

Jan 14 '06 #2
The main question is what can happen if I use text fields in
combination with enctype="multipart/form-data".

Jan 14 '06 #3
op*********@yahoo.com wrote:
The main question is what can happen if I use text fields in
combination with enctype="multipart/form-data".


Well, that's _not_ what you asked first time. Yet, it too _was_ answered in
my message.

Consider reading what I wrote. If problems remain, please quote the part you
didn't understand and try to explain why you find it difficult.

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

Jan 14 '06 #4
> > The main question is what can happen if I use text fields in
combination with enctype="multipart/form-data".


Well, that's _not_ what you asked first time. Yet, it too _was_ answered in
my message.


Your answer should be here.
In other cases one needs to use:
enctype="application/x-www-form-urlencoded"

No, you don't. First, it's the default, so it need not be specified
explicitly. Second, enctype="multipart/form-data" can be used even if there
is no file input field. It's just about the format of encoding form data.

However, it is not full answer. I know that value of enctype change
format of encoding. The question is what exectly these changes are? How
I can see these changes. I posted values of text fields with the usage
of both values of enctype and I did not find any differences.

Jan 15 '06 #5
op*********@yahoo.com wrote:
Well, that's _not_ what you asked first time. Yet, it too _was_ answered
in my message.
Your answer should be here.
If you don't like being refered back to a previous answer instead of having
redundant copy/pasting dumped into the thread, then I'm sure that Jukka
would be quite happy to provide you will a full refund of everything you've
paid him for his help on this matter.
However, it is not full answer. I know that value of enctype change
format of encoding. The question is what exectly these changes are? How
I can see these changes.
If you really care then you can look at the differences in STDIN and
environment variables received by your server side script ... but since
pretty much every form handling library deals with such things
transparently, it doesn't really make much practical difference[1].
I posted values of text fields with the usage
of both values of enctype and I did not find any differences.


Presumably because your form handling library handles it transparently (as
is only sensible), so it makes no practical difference to you.

[1] Unless you are writing your own such library, but I wouldn't recommend
attempting that if you aren't skilled enough to find the specification that
you want to implement.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jan 15 '06 #6
Thank you for your answer.

P.S. Sometimes it is easier to get answer in newsgroups than to read
hundreds of pages overfilled by a formalized syntax. One person spends
30 second to help me avoid hours of usefulness search and reading. It
is for what forums are, isn't. Moreover, one needs to remember that
nobody is forced to give me answer.

Jan 15 '06 #7
op*********@yahoo.com wrote:
P.S. Sometimes it is easier to get answer in newsgroups than to read
hundreds of pages overfilled by a formalized syntax.
Umm. "The post you just responded to" was not "hundreds of pages overfilled
by a formalized syntax". The closest anybody came to suggesting you read
something like that was my comment that you would need to if you were
implementing a form processing library ... which doesn't seem likely given
your earlier remarks.
Moreover, one needs to remember that nobody is forced to give me answer.


All the more reason for you to be polite.... which includes following the
Usenet convention of quoting sufficient material from the post you are
responding to to make clear the context of your message.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jan 15 '06 #8
On Sun, 15 Jan 2006 12:06:15 +0000, in
<dq*******************@news.demon.co.uk>
(comp.infosystems.www.authoring.html) David Dorward
<do*****@yahoo.com> wrote:
All the more reason for you to be polite....


One's reasons to be polite are substantially eroded once one's
correspondent takes it upon himself to be condescendingly rude and
patronising to one, don't you think?
--
Charlie
Jan 15 '06 #9
On 15/01/2006 15:41, Charlie King wrote:

[snip]
One's reasons to be polite are substantially eroded once one's
correspondent takes it upon himself to be condescendingly rude and
patronising to one, don't you think?


No, not particularly. The "They started it!" defence is something one
should expect from children, not adults.

If one were so offended, one should either refrain from posting, or
kill-file the offending person. It would, of course, be nice to never
experience discourtesy, but such a thing will be forever present
(especially in Usenet).

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
Jan 15 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: David Lozzi | last post by:
I am using an upload util and I was told I need this option, enctype="multipart/form-data", in my FORM tag. How do I reference the other form fields within the form from ASP? THanks, --...
2
by: gRizwan | last post by:
Hello all. can any one tell how can we receive POST data in a ASP form with enctype="text/plain" ? thanks. Riz
4
by: Alex Sibilev | last post by:
Hello, I have a really weird problem I've been trying to solve it without any luck for the last couple of hours :( I'm writing a "conference board" application (quite similar to ASP.NET...
3
by: raj chahal | last post by:
Hi there i have created a registration page containing a form than sends username password to an asp processing page. If the user exists it sends the user back to the registration page with...
27
by: Chris | last post by:
Hi, I have a form for uploading documents and inserting the data into a mysql db. I would like to validate the form. I have tried a couple of Javascript form validation functions, but it...
2
ammoos
by: ammoos | last post by:
hi friends may i know the use of enctype="multipart/form-data" in the asp.net pages eg; <form enctype="multipart/form-data" runat="server"> thanks
2
by: =?Utf-8?B?QWxleCBNYWdoZW4=?= | last post by:
I have a MasterPage. The MasterPage actually contains the <formtag which is used throughout the site. On just certain pages that use that MasterPage, I need the "enctype" for the <formtag to be...
5
by: Shelly | last post by:
First: I have a master page that has the form tag in it. My content page, on one occasion, needs a different type of form (uploading files needs encytype="multipart/form-data"). I solved this by...
7
by: vunet | last post by:
My form uploads files by submitting them to hidden IFrame. I set enctype "multipart/form-data" dynamically. This works great everywhere but IE6. I discovered that in IE6 I need to set encoding...
4
by: vunet | last post by:
Hello, My HTML form submits some values to a hidden iframe. However, this is done for file upload fields only. After file uploading is finished I am using this form to submit all other data...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.