Contenttype=text/xml

R

René van Kessel

Hello.

I want to post a XML-file to a web server using method=post and
contenttype=text/xml.
How should I set the contenttype in my HTML file? Is it possible to do this
or should I use asp or php or something like that?

I have tried the following without succes:

<html>
<head>
<meta http-equiv="Content-Type" request.content="text/xml;
charset=iso-8859-1">
</head>
<body>

<form method="post" action="http://ipaddress/myDLL.dll/xml">
<INPUT TYPE="text" NAME="INPUT1">
</form>

</body>
</html>

Thanks,
René
 
P

Philip Ronan

René van Kessel said:
Hello.

I want to post a XML-file to a web server using method=post and
contenttype=text/xml.
How should I set the contenttype in my HTML file? Is it possible to do this
or should I use asp or php or something like that?

That should happen automatically. When you use an HTML form to post a file
to a server, it is sent with the content type set to "multipart/form-data".
The part of the POST data corresponding to your XML file ought to have a
content-type of text/xml. If that isn't happening then maybe there's
something wrong with your browser.

I assume you're familiar with this:
<http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.3>
 
R

René van Kessel

Thanks for your answer. To be honest we normally don't devellop many
internet stuff, but maily 'normal' Windows application. Developping a form
and sending input to a web server works fine, but one of our customers now
needs to send booking data to a cutomer of them using post method and
contenttype text/xml.

Default the content type is "application/x-www-form-urlencoded", and not
"multipart/form-data" like you said.

And the contenttype is not automatically set to text/xml when we paste a
xml-file in an text-input.

Shouldn't we use something like this:

<form name="form" method="post" action="http://ipaddress/XML.dll/xml"
enctype="text/xml">

Thanks.
 
R

René van Kessel

Some extra information:

When I use

<form name="form" method="post" action="http://ipaddress/XML.dll/xml"
enctype="multipart/form-data">

then the contenttype at the webserver is really multipart/form-data.

When I use enctype="text/xml" then the default
(application/x-www-form-urlencoded) is used...

Anyone an idea??
 
P

Philip Ronan

René van Kessel said:
Thanks for your answer. To be honest we normally don't devellop many
internet stuff, but maily 'normal' Windows application. Developping a form
and sending input to a web server works fine, but one of our customers now
needs to send booking data to a cutomer of them using post method and
contenttype text/xml.

Default the content type is "application/x-www-form-urlencoded", and not
"multipart/form-data" like you said.

If you're trying to upload a file, use enctype="multipart/form-data"
And the contenttype is not automatically set to text/xml when we paste a
xml-file in an text-input.

You can send more than one thing with a form. The XML file should be sent
with a content-type of text/xml. Any other data you provide in the form may
be sent with a different content type, depending on what sort of content it
is.
Shouldn't we use something like this:

<form name="form" method="post" action="http://ipaddress/XML.dll/xml"
enctype="text/xml">

No. Use enctype="multipart/form-data".
 
T

Toby Inkster

René van Kessel said:
Anyone an idea??

Yes -- Philip seems to have an idea. You don't seem to have any idea.

The enctype attribute on a form has precisely two possible values:

* multipart/form-data
* application/x-www-form-urlencoded

For uploading a file, the former should be used. You really don't seem to
understand HTTP. Perhaps you should hire someone who does to add this
feature.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,815
Messages
2,569,705
Members
45,494
Latest member
KandyFrank

Latest Threads

Top