Any way to PUT binary data using xforms upload?

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

Any way to PUT binary data using xforms upload?

Damon Rand-2
Hi,
     I'm trying to write an xform thats PUTs files up to a WebDAV
server.. I thought this was an obvious use case but its seems not to
be possible?

My submission looks like..
<xforms:submission id="upload" method="put"
                                action="http://host/webdav/folder/file.txt" indent="true"
instance="upload-data"
                                includenamespaceprefixes="#default"  mediatype="application/octet-
stream">
</xforms:submission>

When I use anyURI..
<xforms:bind id="file" type="xsd:anyURI" nodeset="instance('upload-
data')/file" required="0"/>

I get this being saved into the DAV server. Which is obviously
useless.
<root xmlns=""><file>file:///D:/profiles/drand/Desktop/
act500022006_en.rtf</file></root>

And when I change the type to xs:base64Binary I get and equally
unghelpful file on the dav server.
<root
xmlns=""><file>e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZGVmZjBcZGVmbGFuZzEwMz==</
file></root>

Please tell me I'm missing something obvious????

Regards,
Damon.

_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: Any way to PUT binary data using xforms upload?

Aaron Reed
Hi Damon,

I don't know that you can do this with a binary file without some work
on the server.  If you notice, PUT and POST both serialize data as XML
and if you use multipart-post or form-data-post, I think that you'd
still need server side intervention to take the stream and put it in a file.

Here is an article that explains one way to do it:
http://www.ibm.com/developerworks/xml/library/x-xformstipuploadphp/index.html?S_TACT=105AGX06&S_CMP=EDU

On DeveloperWorks there are also articles on how to handle the data
using perl or Java.

I hope that this helps,
--Aaron

trisk3ll wrote:

> Hi,
>      I'm trying to write an xform thats PUTs files up to a WebDAV
> server.. I thought this was an obvious use case but its seems not to
> be possible?
>
> My submission looks like..
> <xforms:submission id="upload" method="put"
> action="http://host/webdav/folder/file.txt" indent="true"
> instance="upload-data"
> includenamespaceprefixes="#default"  mediatype="application/octet-
> stream">
> </xforms:submission>
>
> When I use anyURI..
> <xforms:bind id="file" type="xsd:anyURI" nodeset="instance('upload-
> data')/file" required="0"/>
>
> I get this being saved into the DAV server. Which is obviously
> useless.
> <root xmlns=""><file>file:///D:/profiles/drand/Desktop/
> act500022006_en.rtf</file></root>
>
> And when I change the type to xs:base64Binary I get and equally
> unghelpful file on the dav server.
> <root
> xmlns=""><file>e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZGVmZjBcZGVmbGFuZzEwMz==</
> file></root>
>
> Please tell me I'm missing something obvious????
>
> Regards,
> Damon.
>
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

RE: Any way to PUT binary data using xforms upload?

Klotz, Leigh
I'll add this as an idea for XForms 1.2/2.0.
trisk3ll wrote:
> Hi,
>      I'm trying to write an xform thats PUTs files up to a WebDAV
> server.. I thought this was an obvious use case but its seems not to
> be possible?
>
> My submission looks like..
> <xforms:submission id="upload" method="put"
>
action="http://host/webdav/folder/file.txt" indent="true"
> instance="upload-data"
> includenamespaceprefixes="#default"
mediatype="application/octet-

> stream">
> </xforms:submission>
>
> When I use anyURI..
> <xforms:bind id="file" type="xsd:anyURI" nodeset="instance('upload-
> data')/file" required="0"/>
>
> I get this being saved into the DAV server. Which is obviously
> useless.
> <root xmlns=""><file>file:///D:/profiles/drand/Desktop/
> act500022006_en.rtf</file></root>
>
> And when I change the type to xs:base64Binary I get and equally
> unghelpful file on the dav server.
> <root
>
xmlns=""><file>e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZGVmZjBcZGVmbGFuZzEwMz==<
/
> file></root>
>
> Please tell me I'm missing something obvious????
>
> Regards,
> Damon.
>
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: Any way to PUT binary data using xforms upload?

Damon Rand-2
In reply to this post by Aaron Reed
On Sep 5, 10:06 pm, "Klotz, Leigh" <[hidden email]> wrote:
> I'll add this as an idea for XForms 1.2/2.0.trisk3ll wrote:

Thanks!

In the meantime, I'm thinking it might be possible to use Javascript
and XMLHTTP directly to take an xforms xsi:anyURI local filename and
PUT it up. I'll post if I get that working..

Damon.

_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms