Re: bug in windows with adodb

Tech-Archive recommends: Speed Up your PC by fixing your registry




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

.



Relevant Pages

  • Did anyone upload file to php server by using swing applet before? Need help!!!
    ... Recently I wrote a swing applet for uploading files to ... same size files in the server. ... String file_name = file.getName; ... HttpURLConnection conn = null; ...
    (comp.lang.java.programmer)
  • Re: Encrypted Connection String and Security....Quick Question
    ... Why don't you put the encrypted string straight into the web.config before ... I then encrypt the connection string using ... I upload the site to the shared hosting server. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Encoding problem
    ... bytemessage representing a base64 encoded string. ... The server is sending ... I could decode the base64 string successfully using ...
    (microsoft.public.dotnet.languages.csharp)
  • Base64 length
    ... I've managed to encode an image file to base64 using ... I know you cannot send the whole string to the server, ...
    (microsoft.public.dotnet.languages.csharp)
  • SQL Connection Problem
    ... An error has occurred while establishing a connection to the server. ... database location within the applications App_Data directory. ... Boolean& failoverDemandDone, String host, String failoverPartner, String ... user, String password, Boolean trusted, String connectionString) +68 ...
    (microsoft.public.dotnet.framework.aspnet)