Upload Control

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

Upload Control

damien.peymirat
Hi,


I'm a new user of PresentationServer and I have some problems with XForms. I want to upload a file on my server and to display the file name on the same page. However, I don't know where to specify the final location on the server and I have an error : Unsupported type: xs:anyURI when I try to upload a file. Can you help me please ???


Here is my xhtml code :

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="2.0" xmlns:xsi
  ="http://www.w3.org/2001/XMLSchema-instance" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms">
<head>
        <title>Upload de fichiers</title>
        <xforms:model>
                <xforms:instance>
                        <files xmlns="">  
                                <file filename="" mediatype="" size="" xsi:type="xs:anyURI"/>  
                        </files>
                </xforms:instance>
                <xforms:submission id="upload" method="post" encoding="multipart/form-data"/>
        </xforms:model>
</head>
<body>
       

                <xforms:upload ref="/files/file[1]" incremental="true">  
                        <xforms:filename ref="@filename"/>  
                        <xforms:mediatype ref="@mediatype"/>  
                        <xxforms:size ref="@size"/>
                </xforms:upload>
     
      <xforms:submit submission="upload">
                        <xforms:label>Upload !!!</xforms:label>
                </xforms:submit>
                               
                <p><xforms:output value="/file/file[1]/@filename"/></p>

       
</body>
</html>



--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Upload Control

Pascal Heus
Damien:
I think you're just missing the xmlns:xs declaration in the root <html> element:
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
hope this helps,
Pascal

On 7/10/06, [hidden email] <[hidden email]> wrote:
Hi,


I'm a new user of PresentationServer and I have some problems with XForms. I want to upload a file on my server and to display the file name on the same page. However, I don't know where to specify the final location on the server and I have an error : Unsupported type: xs:anyURI when I try to upload a file. Can you help me please ???


Here is my xhtml code :

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xforms="http://www.w3.org/2002/xforms " xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="2.0" xmlns:xsi
  =" http://www.w3.org/2001/XMLSchema-instance" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms">
<head>
        <title>Upload de fichiers</title>
        <xforms:model>
                <xforms:instance>
                        <files xmlns="">
                                <file filename="" mediatype="" size="" xsi:type="xs:anyURI"/>
                        </files>
                </xforms:instance>
                <xforms:submission id="upload" method="post" encoding="multipart/form-data"/>
        </xforms:model>
</head>
<body>


                <xforms:upload ref="/files/file[1]" incremental="true">
                        <xforms:filename ref="@filename"/>
                        <xforms:mediatype ref="@mediatype"/>
                        <xxforms:size ref="@size"/>
                </xforms:upload>

                <xforms:submit submission="upload">
                        <xforms:label>Upload !!!</xforms:label>
                </xforms:submit>

                <p><xforms:output value="/file/file[1]/@filename"/></p>


</body>
</html>




--
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
ObjectWeb mailing lists service home page: http://www.objectweb.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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Upload Control

Erik Bruchez
Administrator
In reply to this post by damien.peymirat
Damien,

One thing is that your xforms:submission is incorrect. It looks like you
are using the old XForms Classic way of specifying an XForms submission.
For a complete example of xforms:submission, see the XForms Upload
Control example:

   http://www.orbeon.com/ops/goto-source/xforms-upload/main-view.xsl

-Erik

[hidden email] wrote:

> Hi,
>
>
> I'm a new user of PresentationServer and I have some problems with XForms. I want to upload a file on my server and to display the file name on the same page. However, I don't know where to specify the final location on the server and I have an error : Unsupported type: xs:anyURI when I try to upload a file. Can you help me please ???
>
>
> Here is my xhtml code :
>
> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="2.0" xmlns:xsi
>   ="http://www.w3.org/2001/XMLSchema-instance" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms">
> <head>
> <title>Upload de fichiers</title>
> <xforms:model>
> <xforms:instance>
> <files xmlns="">  
> <file filename="" mediatype="" size="" xsi:type="xs:anyURI"/>  
> </files>
> </xforms:instance>
> <xforms:submission id="upload" method="post" encoding="multipart/form-data"/>
> </xforms:model>
> </head>
> <body>
>
>
> <xforms:upload ref="/files/file[1]" incremental="true">  
> <xforms:filename ref="@filename"/>  
> <xforms:mediatype ref="@mediatype"/>  
> <xxforms:size ref="@size"/>
> </xforms:upload>
>      
>       <xforms:submit submission="upload">
> <xforms:label>Upload !!!</xforms:label>
> </xforms:submit>
>
> <p><xforms:output value="/file/file[1]/@filename"/></p>
>
>
> </body>
> </html>
>
>
>
> ------------------------------------------------------------------------
>
>
> --
> 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
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws

--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/



--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Upload Control

Tanya Gray (Oxford)
In reply to this post by damien.peymirat
The xpl file that processes the submitted form xml instance requires the following:

-- de-reference xs:anyURI from form instance
-- file-serializer - write to file
-- xslt processor to return instance including filename to web page
 
It's worth looking at the upload example on the orbeon web site, if you haven't already done so. Specifically, the read-uri.xpl file - change the content-type as required.

Also, if you use the read-uri.xpl file, you can call it using the following (from the main-model.xpl file):
   <!-- Dereference the xs:anyURI obtained from the instance (for the first file with an URI only) -->
            <p:processor name="oxf:pipeline">
                <p:input name="config" href="read-uri.xpl"/>
                <p:input name="uri" href="aggregate('uri', #instance#xpointer(string(/*/files/file[. != ''][1])))"/>
                <p:output name="data" id="file"/>
            </p:processor>
 

Example file serializer processor:

<p:processor name="oxf:file-serializer" xmlns:p="http://www.orbeon.com/oxf/pipeline">
 <p:input name="config">  
<config>
 <file>test.html</file>
 <directory>c:/build/doc</directory>  
<content-type>text/html</content-type>
 <public-doctype>-//W3C//DTD HTML 4.01//EN</public-doctype>  <system-doctype>http://www.w3.org/TR/html4/strict.dtd</system-doctype>  <encoding>utf-8</encoding>  <indent-amount>4</indent-amount>
 </config>
</p:input>  
<p:input name="data" href="#file"/>
 </p:processor>















>>> [hidden email] 07/10/06 4:56 PM >>>
Hi,


I'm a new user of PresentationServer and I have some problems with XForms. I want to upload a file on my server and to display the file name on the same page. However, I don't know where to specify the final location on the server and I have an error : Unsupported type: xs:anyURI when I try to upload a file. Can you help me please ???


Here is my xhtml code :

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="2.0" xmlns:xsi
  ="http://www.w3.org/2001/XMLSchema-instance" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms">
<head>
        <title>Upload de fichiers</title>
        <xforms:model>
                <xforms:instance>
                        <files xmlns="">  
                                <file filename="" mediatype="" size="" xsi:type="xs:anyURI"/>  
                        </files>
                </xforms:instance>
                <xforms:submission id="upload" method="post" encoding="multipart/form-data"/>
        </xforms:model>
</head>
<body>
       

                <xforms:upload ref="/files/file[1]" incremental="true">  
                        <xforms:filename ref="@filename"/>  
                        <xforms:mediatype ref="@mediatype"/>  
                        <xxforms:size ref="@size"/>
                </xforms:upload>
     
      <xforms:submit submission="upload">
                        <xforms:label>Upload !!!</xforms:label>
                </xforms:submit>
                               
                <p><xforms:output value="/file/file[1]/@filename"/></p>

       
</body>
</html>



--
This message (and any attachments) is for the recipient only. NERC
is subject to the Freedom of Information Act 2000 and the contents
of this email and any reply you make may be disclosed by NERC unless
it is exempt from release under the Act. Any material supplied to
NERC may be stored in an electronic records management system.




--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws