Re: treating (multiple) attached images

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 UTC