473,403 Members | 2,270 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Msxml2.XMLHTTP Takes Too Long To Upload File

Uploading from browser to server using Msxml2.XMLHTTP takes a long time about 15 minutes for a 1.5MB file at 37.2Kbps, although it does get there. Is there anyway to speed things up?

here's the code ...
var sFilename = (document.form1.myFileName.value);

// create ADO-stream Object

var ado_stream = new ActiveXObject("ADODB.Stream");

// create XML document with default header and primary node

var xml_dom = new ActiveXObject("MSXML2.DOMDocument");

xml_dom.loadXML('<?xml version="1.0" ?> <root/>');

// specify namespaces datatypes

xml_dom.documentElement.setAttribute("xmlns:dt", "urn:schemas-microsoft-com:datatypes");

// create a new node and set binary content

var l_node1 = xml_dom.createElement("file1");

l_node1.dataType = "bin.base64";

// open stream object and read source file

ado_stream.Type = 1; // 1=adTypeBinary

ado_stream.Open();

ado_stream.LoadFromFile(sFilename);

// store file content into XML node

l_node1.nodeTypedValue = ado_stream.Read(-1); // -1=adReadAll

ado_stream.Close();

xml_dom.documentElement.appendChild(l_node1);

// send XML documento to Web server

var xmlhttp = new ActiveXObject("MSXML2.XMLHTTP");

xmlhttp.open("POST","http://www.mydomain.com/xmlupload.asp",false);

xmlhttp.send(xml_dom);
// show server message in message-area

div_message.innerHTML = xmlhttp.ResponseText;

--
Dan Sikorsky, MSCS BSCE BAB
Jul 19 '05 #1
3 12424
I assume you've compared this performance against major upload components,
such as aspupload and sa-fileup?

"Dan Sikorsky" <ds****@gte.net> wrote in message
news:#Y**************@TK2MSFTNGP12.phx.gbl...
Uploading from browser to server using Msxml2.XMLHTTP takes a long time
about 15 minutes for a 1.5MB file at 37.2Kbps, although it does get there.
Is there anyway to speed things up?

here's the code ...
var sFilename = (document.form1.myFileName.value);
// create ADO-stream Object
var ado_stream = new ActiveXObject("ADODB.Stream");
// create XML document with default header and primary node
var xml_dom = new ActiveXObject("MSXML2.DOMDocument");
xml_dom.loadXML('<?xml version="1.0" ?> <root/>');
// specify namespaces datatypes
xml_dom.documentElement.setAttribute("xmlns:dt",
"urn:schemas-microsoft-com:datatypes");
// create a new node and set binary content
var l_node1 = xml_dom.createElement("file1");
l_node1.dataType = "bin.base64";
// open stream object and read source file
ado_stream.Type = 1; // 1=adTypeBinary
ado_stream.Open();
ado_stream.LoadFromFile(sFilename);
// store file content into XML node
l_node1.nodeTypedValue = ado_stream.Read(-1); // -1=adReadAll
ado_stream.Close();
xml_dom.documentElement.appendChild(l_node1);
// send XML documento to Web server
var xmlhttp = new ActiveXObject("MSXML2.XMLHTTP");
xmlhttp.open("POST","http://www.mydomain.com/xmlupload.asp",false);
xmlhttp.send(xml_dom);
// show server message in message-area
div_message.innerHTML = xmlhttp.ResponseText;
--
Dan Sikorsky, MSCS BSCE BAB
Jul 19 '05 #2
No I haven't. I've had pretty good success developing components independent
of 3rd party products.

Am I getting better performance than your mentioned components?

Is MSXML2.XMLHTTP not the way to move 1 - 5 MB files around the Internet?
(If not: What is?)

My website(s) are hosted; in the beginning years of the Internet and ASP, a
phone call was all that was necessary to have the host register any of my
DLLs. But, they don't do that anymore - for security reasons. So, unless the
host already offers components for development use, and some do, I need pure
ASP code on my web pages.

I am also using similar logic - MSXML2.ServerXMLHTTP - to download files
from server to browser, and have yet to determine any performance issues
(which will likewise be posted in this newsgroup, as needed).

--
Dan Sikorsky, MSCS BSCE BAB
"Aaron Bertrand [MVP]" <aa***@TRASHaspfaq.com> wrote in message
news:eE*************@tk2msftngp13.phx.gbl...
I assume you've compared this performance against major upload components,
such as aspupload and sa-fileup?

"Dan Sikorsky" <ds****@gte.net> wrote in message
news:#Y**************@TK2MSFTNGP12.phx.gbl...
Uploading from browser to server using Msxml2.XMLHTTP takes a long time
about 15 minutes for a 1.5MB file at 37.2Kbps, although it does get there.
Is there anyway to speed things up?

here's the code ...
var sFilename = (document.form1.myFileName.value);
// create ADO-stream Object
var ado_stream = new ActiveXObject("ADODB.Stream");
// create XML document with default header and primary node
var xml_dom = new ActiveXObject("MSXML2.DOMDocument");
xml_dom.loadXML('<?xml version="1.0" ?> <root/>');
// specify namespaces datatypes
xml_dom.documentElement.setAttribute("xmlns:dt",
"urn:schemas-microsoft-com:datatypes");
// create a new node and set binary content
var l_node1 = xml_dom.createElement("file1");
l_node1.dataType = "bin.base64";
// open stream object and read source file
ado_stream.Type = 1; // 1=adTypeBinary
ado_stream.Open();
ado_stream.LoadFromFile(sFilename);
// store file content into XML node
l_node1.nodeTypedValue = ado_stream.Read(-1); // -1=adReadAll
ado_stream.Close();
xml_dom.documentElement.appendChild(l_node1);
// send XML documento to Web server
var xmlhttp = new ActiveXObject("MSXML2.XMLHTTP");
xmlhttp.open("POST","http://www.mydomain.com/xmlupload.asp",false);
xmlhttp.send(xml_dom);
// show server message in message-area
div_message.innerHTML = xmlhttp.ResponseText;
--
Dan Sikorsky, MSCS BSCE BAB

Jul 19 '05 #3
> No I haven't. I've had pretty good success developing components
independent
of 3rd party products.
Well (and as you mention below), sometimes you have to use 3rd party
products because your own are not "trusted."
Am I getting better performance than your mentioned components?
I have no idea what performance you are getting or how you are measuring, so
I can't answer that question. All I'm suggesting is that you TRY the
various vendor components and compare, instead of assuming there's some way
to simply enhance your existing code and magically have improved
performance.
Is MSXML2.XMLHTTP not the way to move 1 - 5 MB files around the Internet?
(If not: What is?)
I would guess not. If you are uploading files from the client to the
server, a normal <form enctype=multipart/form-data and an upload component
on the receiving end will certainly be no worse, and might be better.
DLLs. But, they don't do that anymore - for security reasons. So, unless the host already offers components for development use,
Any host worth its salt has either ASPUpload, SAFileUp, or both. Drop their
tech support an e-mail. It's sad to see such a defeatist attitude...
I am also using similar logic - MSXML2.ServerXMLHTTP - to download files
from server to browser, and have yet to determine any performance issues
(which will likewise be posted in this newsgroup, as needed).


Why? How about ADODB.Stream and Response.BinaryWrite?

99.9% of the usage I've seen MSXML2.ServerXMLHTTP has been for retrieving
plain text, not for handling binary data. HTTP alone works fine for
transferring files, and there are several tried and true methods for doing
so that do not include MSXML2.ServerXMLHTTP.
Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Eric | last post by:
I have a form with an INPUT type=file in it. I have another button that calls a function to exercise the oHTTP below. I think I need to open with the path of the CGI script on the server. What...
23
by: Roland Hall | last post by:
I wrote a small script that grabs two CSV files from a remote web site, parses them out and displays them in scrolling divs. The first file has a little over 27k records, the second has less. It...
3
by: Steven Burn | last post by:
The application; Service on my webserver that allows a user to upload their HOSTS file for functions to verify the contents are still valid. Uses; 1. XMLHTTP (MSXML2) 2. FileSystemObject...
5
by: RK | last post by:
I am getting the "HTTP /1.1 405 - method not allowed" error when I am sending XML string over Msxml2.XMLHTTP object. I am sending data in POST, also passing querystring variable and here is the...
1
by: Raúl Martín | last post by:
I´ve a function in asp that run correctly but If I tried to change it forasp.net in asp: xmlHTTP = CreateObject("Microsoft.XMLHTTP") And I thought to use this sentence for asp.net but the...
3
by: BjörnHolmberg | last post by:
I'm trying to consume a WS from Excel (Office 98), seems that I can't send arguments into the WS. In order to pinpoint the problem I've written the following application i C# and VB6. It reproduces...
8
by: lopi | last post by:
Hello. I'm trying to remotely get a pdf file - http://remoteServer/file.pdf - in order to store it into another server, maybe with Scripting.FileSystemObject However the following code doesn't...
2
by: noOby | last post by:
Hi developers, currently i'm doing a school project and i am stuck on MSXML2.XMLHTTP conversion from vb code to c#. Below is the vb Coding that i need to convert to C# Dim sUrl As String ...
2
by: Dave | last post by:
I am running the following code and I get an error: Set xmlHttp = Server.CreateObject("MSXML2.XMLHTTP.3.0") xmlHttp.Open "Get", URLToRSS, false xmlHttp.Send RSSXML = xmlHttp.ResponseText The...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.