Re: bug in windows with adodb
- From: "Julian Turner" <julian@xxxxxxxxxxxxxx>
- Date: 8 Nov 2005 09:02:21 -0800
Luismi wrote:
> Hello,
>
> I'm uploading a file to a server using ADODB.Stream in JavaSript, but a
> windows bug does not let me to create the ActiveX Object. I've been
> searching in the MSDN and I found a patch but I have to apply in all the
> clients and modify the registry on them and this is not a valid solution for
> us. Someone knows another way to upload a file using javascript without
> using ADODB.Stream class? It will be very helpful.
Hi. I think it is pretty difficult to in Javascript do without the
ADODB.Stream class.
One possible solution (which is Internet Explorer specific and would
only be good for small files (up to 500k)) could be some rough manual
hack thus (untested):-
1. Use Scripting.FileSystemObject to get the file. I think it can
read binary into a string, but it ceases to be in binary format from
then on.
2. Convert the string to Base64 in Javascript(slow part).
3. Save the Base64 into a special XML node thus:-
var xml_dom = new ActiveXObject("MSXML2.DOMDocument");
xml_dom.loadXML('<?xml version="1.0" ?> <root/>');
xml_dom.documentElement.setAttribute("xmlns:dt",
"urn:schemas-microsoft-com:datatypes");
var l_node1 = xml_dom.createElement("file1");
l_node1.dataType = "bin.base64";
l_node1.nodeTypedValue=BASE_64_STRING_GOES_HERE;
xml_dom.documentElement.appendChild(l_node1);
4. Use the HTTPRequest object to send(xml_dom).
5. You will need some server side scripting to access from then on.
Julian
.
- Follow-Ups:
- Re: bug in windows with adodb
- From: Julian Turner
- Re: bug in windows with adodb
- References:
- bug in windows with adodb
- From: Luismi
- bug in windows with adodb
- Prev by Date: Re: How to know which option was clicked in a SELECT
- Next by Date: Re: bug in windows with adodb
- Previous by thread: Re: bug in windows with adodb
- Next by thread: Re: bug in windows with adodb
- Index(es):
Relevant Pages
|