W3C home > Mailing lists > Public > www-forms@w3.org > February 2009

Re: treating (multiple) attached images

From: Steven Pemberton <steven.pemberton@cwi.nl>
Date: Tue, 10 Feb 2009 23:22:28 +0100
To: "Jabba Laci" <jabba.laci@gmail.com>, xforms <www-forms@w3.org>
Message-ID: <op.uo5prqnesmjzpq@acer3010.mtv.corp.google.com>

On Tue, 10 Feb 2009 22:57:06 +0100, Jabba Laci <jabba.laci@gmail.com>  
wrote:

>
>>> I'd like to allow users to attach images to an XForm. Some questions:
>>>
>>> (1) As I saw, only the file URLs are sent, not the files themselves.
>
> Hi,
>
> For reasons of simplicity, I would like to restrict the image upload
> to JPG images only. In the model part I have the following:
>
> <xforms:instance id="xml-template" xmlns="">
>         <Images>
>           <file1 xsi:type="xsd:anyURI" />
> ...
>
> The best solution would be if it were treated in the file selector,
> i.e. the user couldn't even choose a different file.

There's an example in the XForms spec:

	<upload ref="mail/attachment" mediatype="image/*">
	  <label>Select image:</label>
	  <filename ref="@filename" />
	  <mediatype ref="@mediatype" />
	</upload>

The mediatype for jpg is image/jpeg, so use mediatype="image/jpeg"

Best wishes,

Steven Pemberton


> Thanks,
>
> Laszlo
>
Received on Tuesday, 10 February 2009 22:22:39 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 10 March 2012 06:22:15 GMT