submitting a form to an external servlet

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

submitting a form to an external servlet

Alex Sharaz-2
Hi,
I've been looking at using the xforms-upload example as the basis for  
a file upload service that sticks uploaded files into a BLOB column in  
a db2 database.. Got everything working as far as attempting to insert  
the value into the BLPB via an xpl file. That's when i noticed that  
db2 isn;t one of the supported databases for this.

Plan B is to point the submission at a java servlet and do all my  
uploads there. I'm already doing this for another app, so the "only  
problem I've got is persuading the "Upload selected files" button in  
my version of the xforms-upload app to pass things to a servlet. At  
this point all i need is the "files" instance from which I can extract  
the temp file upload information.
  What I thought I'd do is  replace

<xforms:submission id="background-submission" method="post"  
replace="none" resource="test:"/>

with

           <!-- Background submission -->
             <xforms:submission id="background-submission"  
ref="instance('files-instance')" replace="none" instance="main"  
method="post" action="http://newcomms.hull.ac.uk/servlet/ 
uploadFiletoDb">
                <xforms:message ev:event="xforms-submit-error"  
level="modal">An error occurred while uploading the file!</
xforms:message>
                <xforms:message ev:event="xforms-submit-done"  
level="modal">File uploaded successfully</xforms:message>
             </xforms:submission>


Needless to say it don't work.
What would be the best way of doing this.?

ALEX

==========
Time for another Macmillan Cancer Support event. This time its the  
Trans Central America cycle challenge -680Km in 8 days.

Please sponsor me at http://www.justgiving.com/alexsharaz



--
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: submitting a form to an external servlet

Alessandro Vernet
Administrator
Alex,

On Mar 3, 2009, at 5:55 AM, Alex Sharaz wrote:

> I've been looking at using the xforms-upload example as the basis  
> for a file upload service that sticks uploaded files into a BLOB  
> column in a db2 database.. Got everything working as far as  
> attempting to insert the value into the BLPB via an xpl file. That's  
> when i noticed that db2 isn;t one of the supported databases for this.

BTW, it *might* still work. Did you try to send a BLOB to DB2 using  
the SQL processor? If it doesn't work, plan C is to change the SQL  
processor to support DB2 ;).

> Plan B is to point the submission at a java servlet and do all my  
> uploads there. I'm already doing this for another app, so the "only  
> problem I've got is persuading the "Upload selected files" button in  
> my version of the xforms-upload app to pass things to a servlet. At  
> this point all i need is the "files" instance from which I can  
> extract the temp file upload information.
> What I thought I'd do is  replace
>
> <xforms:submission id="background-submission" method="post"  
> replace="none" resource="test:"/>
>
> with
>
>          <!-- Background submission -->
>            <xforms:submission id="background-submission"  
> ref="instance('files-instance')" replace="none" instance="main"  
> method="post" action="http://newcomms.hull.ac.uk/servlet/uploadFiletoDb 
> ">
>               <xforms:message ev:event="xforms-submit-error"  
> level="modal">An error occurred while uploading the file!</
> xforms:message>
>               <xforms:message ev:event="xforms-submit-done"  
> level="modal">File uploaded successfully</xforms:message>
>            </xforms:submission>
Let's start with a stupid question on my part: is this on a different  
server? If it is, then can that other server access the temporary file  
stored locally? If this is on the same server, you'll need to tell us  
more about what isn't working: does the service receive the instance  
with the file name in it?

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/
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