XForm Upload

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

XForm Upload

Prameela R

Hi,

 

Can we allow the xforms:upload to allow only image files.

 

<xforms:instance id="uploadinstance">

 <uploads  xmlns="">

   <upload>

    <dataFile xsi:type="xsd:base64Binary" filename="" mediatype="" size=""></dataFile>

   </upload>

 </uploads>

</xforms:instance>

 

<xforms:upload   ref="instance('uploadinstance')/upload/dataFile" class="upload">

         <xforms:label>Upload File :</xforms:label>

  <xforms:filename ref="@filename"/>

         <xforms:mediatype ref="@mediatype"/>

</xforms:upload>

 

The above code I used. It accepts all files.But I have to accept only image files.

 

Thanks,

Prameela



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: XForm Upload

Jeroen Hoffman
Hi,
We did something similar with a bind with a constraint on the @mediatype, something like this for you:

    <xforms:bind nodeset="upload/dataFile" constraint="@mediatype = 'image/gif'"/>

Note that this works only after a file has been uploaded and the @mediatype has been filled. We cannot prevent the picker from selecting files of the wrong type.

Jeroen 


On Fri, Mar 13, 2009 at 1:31 PM, Prameela R <[hidden email]> wrote:

Hi,

 

Can we allow the xforms:upload to allow only image files.

 

<xforms:instance id="uploadinstance">

 <uploads  xmlns="">

   <upload>

    <dataFile xsi:type="xsd:base64Binary" filename="" mediatype="" size=""></dataFile>

   </upload>

 </uploads>

</xforms:instance>

 

<xforms:upload   ref="instance('uploadinstance')/upload/dataFile" class="upload">

         <xforms:label>Upload File :</xforms:label>

  <xforms:filename ref="@filename"/>

         <xforms:mediatype ref="@mediatype"/>

</xforms:upload>

 

The above code I used. It accepts all files.But I have to accept only image files.

 

Thanks,

Prameela



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: XForm Upload

Ajmccoy
In reply to this post by Prameela R
Hi Peter,

Yep the new TEMSDatabase fixes the issue.

Thanks
Alan

--------- Original Message --------
From: [hidden email]
To: [hidden email] <[hidden email]>
Subject: [ops-users] Re: XForm Upload
Date: 16/03/09 09:52

> Hi,We did something similar with a bind with a constraint on the
@mediatype, something like this for you:    &lt;xforms:bind
nodeset=&quot;upload/dataFile&quot; constraint=&quot;@mediatype =
&#39;image/gif&#39;&quot;/&gt;
> Note that this works only after a file has been uploaded and the
@mediatype has been filled. We cannot prevent the picker from selecting
files of the wrong type.Jeroen 
> On Fri, Mar 13, 2009 at 1:31 PM, Prameela R
&lt;[hidden email]&gt; wrote:

>
>
>
>
>
>
>
>
>
>
>
>
>
> Hi,
>
>  
>
> Can we allow the xforms:upload to allow only image files.
>
>  
>
> &lt;xforms:instance id=&quot;uploadinstance&quot;&gt;
>
>  &lt;uploads  xmlns=&quot;&quot;&gt;
>
>    &lt;upload&gt;
>
>     &lt;dataFile xsi:type=&quot;xsd:base64Binary&quot;
> filename=&quot;&quot; mediatype=&quot;&quot;
> size=&quot;&quot;&gt;&lt;/dataFile&gt;
>
>    &lt;/upload&gt;
>
>  &lt;/uploads&gt;
>
> &lt;/xforms:instance&gt;
>
>  
>
> &lt;xforms:upload  
> ref=&quot;instance(&#39;uploadinstance&#39;)/upload/dataFile&quot;
> class=&quot;upload&quot;&gt;
>
>          &lt;xforms:label&gt;Upload File :&lt;/xforms:label&gt;
>
>   &lt;xforms:filename ref=&quot;@filename&quot;/&gt;
>
>          &lt;xforms:mediatype ref=&quot;@mediatype&quot;/&gt;
>
> &lt;/xforms:upload&gt;
>
>  
>
> The above code I used. It accepts all files.But I have to accept only
> image files.
>
>  
>
> Thanks,
>
> Prameela
>
>
>
>
>
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing
list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>

________________________________________________
Message sent using UebiMiau 2.7.10




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: XForm Upload

Alessandro Vernet
Administrator
In reply to this post by Jeroen Hoffman
Jeroen,

Jeroen Hoffman wrote
Note that this works only after a file has been uploaded and the @mediatype
has been filled. We cannot prevent the picker from selecting files of the
wrong type.
Exactly, and this is a constraint of the browser. I don't think there is anything we can do directly on the browser to stop someone from selecting a file which is not of a type you want.

Alex