W3C home > Mailing lists > Public > www-jigsaw@w3.org > May to June 2000

HTTP error 500 when posting multi-part/form-data

From: TK Sung <tksung@extravert.com>
Date: Mon, 8 May 2000 12:29:06 -0700
Message-ID: <01BFB8E9.01824AB0@zooey>
To: "'www-jigsaw@w3.org'" <www-jigsaw@w3.org>
Hello

I'm getting 500 when I post multi-part/form-data.  This is something that works under IIS 4.0.  Can someone tell me if I need to do something else to make it work with Jigsaw 2.1.1?

thanks in adv.
--
			...
			connection.setRequestMethod("POST");
			String boundary = generateBoundary();
			connection.setRequestProperty("content-type","multipart/form-data, boundary=" + boundary);
			connection.setDoOutput(true);
			connection.setDoInput(true);
			PrintStream outstream = new PrintStream(connection.getOutputStream());
			outstream.print("--" + boundary);
			sendPart(outstream, boundary, "from", from);
			sendPart(outstream, boundary, "subject", subject);
			sendPart(outstream, boundary, "body", body);
			sendPart(outstream, boundary, "count", String.valueOf(count));
			outstream.print("--\r\n");

			connection.connect();
			outstream.close();

	private void sendPart(PrintStream outstream, String boundary, String name, String value)
	{
			outstream.print("\r\ncontent-disposition: form-data; name=\"" + name + "\"\r\n");
			outstream.print("\r\n");
			outstream.print(value);
			outstream.print("\r\n--" + boundary);
	}

Received on Monday, 8 May 2000 15:26:00 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 9 April 2012 12:13:34 GMT