W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > October to December 2012

Re: Multipart/mixed usage in GSP test suite.

From: Andy Seaborne <andy.seaborne@epimorphics.com>
Date: Tue, 20 Nov 2012 11:10:55 +0000
Message-ID: <50AB653F.8030300@epimorphics.com>
To: Chime Ogbuji <chimezie@gmail.com>
CC: SPARQL Working Group <public-rdf-dawg@w3.org>


On 20/11/12 01:18, Chime Ogbuji wrote:
> Hey Andy, see my response inline below.
>
> On Friday, November 16, 2012 at 1:34 PM, Andy Seaborne wrote:
>> Chime,
>>
>> I have having problems with the multipart POST test. I have tried
>> creating a multipart form POST with curl and also from a HTML form
>> inside chrome. I'm not getting the format of the test. I don't get use
>> for multipart/mixed inside a multipart/form-data.
>>
>> Which tool did you use to create the test example?
> The test example is a hand-crafted version of the multipart form data here:
>
> http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.2
>
> The actual multipart form content that the validator sends to the protocol instance is at the bottom of this email.  It was easier
> to use the tool to construct a multi-part form request from the components of the request than from the verbatim request as it is in the test example.
>
> The tool is called poster [1] and it doesn't seem to use multipart/mixed as shown in the HTML 4 documentation.

That is because I believe the use of multipart/mixed is not required and 
indeed common practice is not to use it.

Having used Firefox and Chrome, as well as curl, to generate form 
requests, and using the Apache Commons Upload code to parse the incoming 
request, I have not seen any use of multipart/mixed.  I don't believe it 
is common use with browsers, only with email.

> However, that document says "If multiple files are to be returned as the result of a single form entry, they should be returned as 'multipart/mixed' embedded within the 'multipart/form-data'".

The GSP spec only says multipart/form-data needs to be supported.
"""
where each document is uploaded using the standard web form file upload 
widget
"""
nothing about a specific variant.

There are different ways to have multiple files in a form:

* multiple form fields
* one form form field, multiple times

and they all meet the spec text.  What is more, multiple files per form 
field do not use multipart/mixed in the real web.

e.g.

  <input type="file" name="NAME" size="40" multiple="">

but I do not get multipart/mixed.

I get (Chrome, Firefox):

Content-Type = multipart/form-data; 
boundary=---------------------------10497157321038958566787385981

 >>>> Body

-----------------------------10497157321038958566787385981
Content-Disposition: form-data; name="UNSET FILE NAME"; 
filename="datafile.ttl"
Content-Type: application/octet-stream

@prefix :  .

   :p 123 .
   :p 456 .
   :p 789 .

-----------------------------10497157321038958566787385981
Content-Disposition: form-data; name="UNSET FILE NAME"; 
filename="datafile-2.ttl"
Content-Type: application/octet-stream

@prefix :  .

   :p "abc" .
   :p "def" .

-----------------------------10497157321038958566787385981--
<<<< Body

	Andy

>
> --a6fe4cd636164618814be9f8d3d1a0de
> Content-Disposition: form-data; name="lastName.ttl"; filename="lastName.ttl"
> Content-Type: text/turtle; charset=utf-8
>
> @prefix foaf: <http://xmlns.com/foaf/0.1/> .
> < .. person/1 ..> foaf:familyName "Doe"
>
>
> --a6fe4cd636164618814be9f8d3d1a0de
> Content-Disposition: form-data; name="firstName.ttl"; filename="firstName.ttl"
> Content-Type: text/turtle; charset=utf-8
>
> @prefix foaf: <http://xmlns.com/foaf/0.1/> .
> < .. person/1 .. > foaf:givenName "Jane"
>
>
> --a6fe4cd636164618814be9f8d3d1a0de--
>
> [1] http://atlee.ca/software/poster/
>
> --
> Chime Ogbuji
>
> Sent with Sparrow (http://www.sparrowmailapp.com)
>
Received on Tuesday, 20 November 2012 11:11:29 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:15:49 GMT