http://www.orbeon.com/orbeon/xforms-upload/

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

http://www.orbeon.com/orbeon/xforms-upload/

Tony Graham
The source code for this sample [1] suggests that the form will display
only uploaded JPEG images and that there will be an error message if the
uploaded file is not a JPEG.

Using Firefox on Linux, I don't get any error messages for non-JPEG
uploads, and an uploaded PNG displays fine.

What is the expected behaviour of this form?

Regards,


Tony Graham                         [hidden email]
Director                                  W3C XSL FO SG Invited Expert
Menteith Consulting Ltd                               XML Guild member
XML, XSL and XSLT consulting, programming and training
Registered Office: 13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland
Registered in Ireland - No. 428599   http://www.menteithconsulting.com
  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --
xmlroff XSL Formatter                               http://xmlroff.org
xslide Emacs mode                  http://www.menteith.com/wiki/xslide
Unicode: A Primer                               urn:isbn:0-7645-4625-2

[1] main-model.xpl at
    http://www.orbeon.com/orbeon/source-viewer/xforms-upload/


--
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: http://www.orbeon.com/orbeon/xforms-upload/

Alessandro  Vernet
Administrator
Tony,

What in the source suggests that the xforms-upload example only
supports JPEG? It has a mediatype="image/*", which  will show any
image file, but I don't see any specific reference JPEG. Am I missing
something?

Alex

On Fri, Mar 26, 2010 at 7:35 AM, Tony Graham
<[hidden email]> wrote:

> The source code for this sample [1] suggests that the form will display
> only uploaded JPEG images and that there will be an error message if the
> uploaded file is not a JPEG.
>
> Using Firefox on Linux, I don't get any error messages for non-JPEG
> uploads, and an uploaded PNG displays fine.
>
> What is the expected behaviour of this form?
>
> Regards,
>
>
> Tony Graham                         [hidden email]
> Director                                  W3C XSL FO SG Invited Expert
> Menteith Consulting Ltd                               XML Guild member
> XML, XSL and XSLT consulting, programming and training
> Registered Office: 13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland
> Registered in Ireland - No. 428599   http://www.menteithconsulting.com
>  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --
> xmlroff XSL Formatter                               http://xmlroff.org
> xslide Emacs mode                  http://www.menteith.com/wiki/xslide
> Unicode: A Primer                               urn:isbn:0-7645-4625-2
>
> [1] main-model.xpl at
>    http://www.orbeon.com/orbeon/source-viewer/xforms-upload/
>
>
> --
> 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
>
>


--
Orbeon Forms - Web forms, open-source, for the Enterprise -
http://www.orbeon.com/
My Twitter: http://twitter.com/avernet


--
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
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Re: http://www.orbeon.com/orbeon/xforms-upload/

Tony Graham
On Fri, April 2, 2010 2:11 am, Alessandro Vernet wrote:
> What in the source suggests that the xforms-upload example only
> supports JPEG? It has a mediatype="image/*", which  will show any
> image file, but I don't see any specific reference JPEG. Am I missing
> something?

main-model.xpl includes the error message "The uploaded file must be
a JPEG image.":

    <p:choose href="#instance">
        <p:when test="/*/action = 'simple-upload' and /*/files/file != ''
and (/*/files/file[. != ''][1]/@mediatype = 'image/jpeg' or
/*/files/file[. != ''][1]/@mediatype = 'image/pjpeg')">
            <!-- A file was uploaded and we just want to send it back to
the browser -->
...
        </p:when>
        <p:when test="/*/action = 'simple-upload' and not(/*/files/file[.
!= ''][1]/@mediatype = 'image/jpeg' or /*/files/file[. !=
''][1]/@mediatype = 'image/pjpeg')">
            <!-- Return an error message -->
            <p:processor name="oxf:identity">
                <p:input name="data">
                    <message>The uploaded file must be a JPEG
image.</message>
                </p:input>
                <p:output name="data" id="message"/>
            </p:processor>
...
        </p:when>
        <p:otherwise>
            <!-- Forward the URL generated by the action and container
type to the view -->
            <p:processor name="oxf:identity">
                <p:input name="data" href="aggregate('result', #data,
#container-type)"/>
                <p:output name="data" ref="data"/>
            </p:processor>
        </p:otherwise>
    </p:choose>

Regards,


Tony Graham.



--
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: Re: http://www.orbeon.com/orbeon/xforms-upload/

Alessandro  Vernet
Administrator
Tony,

I see: that model is old and not needed anymore. Now the example shows
the file with an <xforms:output mediatype="image/*" value="."/>. So I
removed it to avoid any confusion.

Alex

On Fri, Apr 2, 2010 at 5:25 AM, Tony Graham
<[hidden email]> wrote:

> On Fri, April 2, 2010 2:11 am, Alessandro Vernet wrote:
>> What in the source suggests that the xforms-upload example only
>> supports JPEG? It has a mediatype="image/*", which  will show any
>> image file, but I don't see any specific reference JPEG. Am I missing
>> something?
>
> main-model.xpl includes the error message "The uploaded file must be
> a JPEG image.":
>
>    <p:choose href="#instance">
>        <p:when test="/*/action = 'simple-upload' and /*/files/file != ''
> and (/*/files/file[. != ''][1]/@mediatype = 'image/jpeg' or
> /*/files/file[. != ''][1]/@mediatype = 'image/pjpeg')">
>            <!-- A file was uploaded and we just want to send it back to
> the browser -->
> ...
>        </p:when>
>        <p:when test="/*/action = 'simple-upload' and not(/*/files/file[.
> != ''][1]/@mediatype = 'image/jpeg' or /*/files/file[. !=
> ''][1]/@mediatype = 'image/pjpeg')">
>            <!-- Return an error message -->
>            <p:processor name="oxf:identity">
>                <p:input name="data">
>                    <message>The uploaded file must be a JPEG
> image.</message>
>                </p:input>
>                <p:output name="data" id="message"/>
>            </p:processor>
> ...
>        </p:when>
>        <p:otherwise>
>            <!-- Forward the URL generated by the action and container
> type to the view -->
>            <p:processor name="oxf:identity">
>                <p:input name="data" href="aggregate('result', #data,
> #container-type)"/>
>                <p:output name="data" ref="data"/>
>            </p:processor>
>        </p:otherwise>
>    </p:choose>
>
> Regards,
>
>
> Tony Graham.
>
>
>
> --
> 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
>
>


--
Orbeon Forms - Web forms, open-source, for the Enterprise -
http://www.orbeon.com/
My Twitter: http://twitter.com/avernet


--
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
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet