Hi,
I've a Xforms document with a <xforms:upload ...> and I've written a REST service for uploading the file.
REST service is receiving the request, but the file is getting uploaded to TOMCAT_HOME\temp folder.
Even I removed the submission element's resource value then also the uploading to temp file is happening (I don't know who is uploading behind). When I inspected the source code, the html <form..> tag's action is set to my application context path.
Files in my application:
In the above view.xhtml, the resource atrribute of submission is kept blank intentionally (actually it is http://localhost:8182/upload; my upload REST service)
Please let me know if I m doing some this wrong or if any one has succeeded in implementing the above, please share the code.
ManiKanta G
Twitter/manikantag
-- 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 |
isn't it possible to upload (type: multipart/form-data) file just specifying REST service (without using xpl or URL generator) ?
I googled googled for file uploading in Orbeon with REST.... no clear sign... I end up writing my own REST service and it is accepting multipart/form-data type uploads and working correct.
But when used with Orbeon no luck. I m usig both 3.7beta1, nightly builds.
In nightly builds I hear multippart/form-upload is working fine. Yeah it is working fine but the temporary file path is only coming (used serialization="multipart/form-upload")
I need this for the client demo in the coming 2 days.
If some knows about this, I'll glad to hear from them
Thanks,
ManiKanta G
-- 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 |
Hi,
The xforms-upload example uses a bind with xs:anyURI which makes the selected file being uploaded to a temp directory. You can also use xs:base64Binary which will make the file being embedded encodedly in the xml document. More at http://www.orbeon.com/ops/doc/reference-xforms-guide#xforms-upload Jeroen ManiKanta G wrote:
-- 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 |
Administrator
|
In reply to this post by ManiKanta G-2
> isn't it possible to upload (type: multipart/form-data) file just
> specifying REST service (without using xpl or URL generator) ? Not sure I understand this question. Please clarify what you intend to do. > In nightly builds I hear multippart/form-upload is working fine. > Yeah it is working fine but the temporary file path is only coming > (used serialization="multipart/form-upload") multipart/form-data will serialize any field with xs:anyURI or xs:base64Binary type as a part. On the wire, the data is serialized and there should not be a reference to temporary files if the type is properly set. If the receiving side is Orbeon Forms, then the request processor makes every uploaded file available as a temporary file again. -Erik -- Orbeon Forms - Web Forms for the Enterprise Done the Right Way http://www.orbeon.com/ -- 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 |
In reply to this post by Jeroen Hoffman
Thanks Jeroen. I've used that but no luck as I need to upload to another folder, not to temp folder.
From the doc/spec, xml encoding is not preferable for larger size files, which results much more increase in size, and suggested to use multipart/related (as multipart/from-data is old one).
I've used xs:anyURI (which they suggested) and given url of the REST service (deals with the multipart/form-data upload) but the content type receing is application/xml (this should be when I use xs:base64Binary. Is n't is?)
ManiKanta G
Twitter.com/manikantag -- 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 |
In reply to this post by Erik Bruchez
Please see the view.xhtml code in http://pastie.org/410080.txt
The submission resource is the REST service I wrote to handle the multipart/form-data (I've tested this by uploading a file using normal html form upload).
I've used <xforms:bind nodeset="file" type="xs:anyURI" /> too. Even then also I m getting media type as application/xml, and the REST service is returns bad request header. I suppose the media type should be multipart/form-data. Isn't it???
What does this receiving side? If I got it correct, I m not using any Orbeon/XPL for uploading. Simple REST service.
I saw some replies from mailing list to use file serializer with url processer. I m trying to figer it out. Will this solves my problem? please share the way of doing so.
Thanks,
ManiKanta G
-- 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 |
Below is the request body received by service:
Now I m trying to use the XPL to copy the temp file to the required location.
As far I know I need to use file serializer to read the above response and copy to the required location:
but I m not able to guess where do I need to place this. (I've tried this placing in the 3.7 beta1 bundled upload example's 'do-background-upload.xpl' file. but nothing happening).
Litter confusion! Even I removed all the files and just with the view.xhtml & page-flow.xml the file is uploaded to temp folder. how is this possible?
Am I making a BIG mistake some where?
ManiKanta G
-- 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 |
Administrator
|
On Mar 7, 2009, at 4:04 AM, ManiKanta G wrote:
> Litter confusion! Even I removed all the files and just with the > view.xhtml & page-flow.xml the file is uploaded to temp folder. how > is this possible? > Am I making a BIG mistake some where? First, the support for file uploads with multipart/form-data has been implemented very recently. So you'll need a recent nightly build for this. With a nightly build, you can do it directly in XForms, with an <xforms:submission>. Second, it is hard to get a clear picture of what you are doing and what goes wrong. Could you send us some code that runs in the XForms sandbox example? We don't need to have a real service on the other side to catch the file; you can do the submission to any web site and we can check the HTTP traffic to see if the right content is sent over the wire. 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 |
I've mentioned the source file link in the above mail. Any way http://pastie.org/410080.txt is the link.
ManiKanta G twitter.com/manikantag -- 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 |
Administrator
|
Sorry, I missed it. You just need: 1) To add a serialization="multipart/form-data" to your <xforms:submission>. 2) To add a <xforms:bind nodeset="/file" type="xs:anyURI"/>. And here is modified file. Alex |
Free forum by Nabble | Edit this page |