473,500 Members | 1,605 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Reliability of HTTP Get of ASP page

I have an app that gets a file from a web server. An ASP page is
passed
authenitication data (username, password) and a filename. The file is
read
and then output by the ASP page so the only response is the file I am
requesting. The file I want to receive is XML with the major portion
of it
being a Base64-encoded block.

I use the Indy component TidHTTP to get the file:

HTTPClient.Request.ContentType := 'text/html';
HTTPClient.Request.CacheControl := 'no-cache' ;
Response.Text := HTTPClient.Get (TIdURI.URLEncode (URL)) ;

Problem is that more often than not, the returned file contains
errors. In
a 200k file, 2 or 3 characters are often munged. Occasionally I
manage to
receive the file without errors. Small files are OK.

How reliable is the HTTP protocol? Would it be more reliable to
redirect to
the target file from the ASP page. I say this because HTTP seems to
have no
problems getting .ZIP files or huge setup exe files.

TIA,
Ross

Nov 14 '07 #1
2 1951
"ross-mcm" <ro*****@gmail.comwrote in message
news:11*********************@t8g2000prg.googlegrou ps.com...
I have an app that gets a file from a web server. An ASP page is
passed
authenitication data (username, password) and a filename. The file is
read
and then output by the ASP page so the only response is the file I am
requesting. The file I want to receive is XML with the major portion
of it
being a Base64-encoded block.

I use the Indy component TidHTTP to get the file:

HTTPClient.Request.ContentType := 'text/html';
HTTPClient.Request.CacheControl := 'no-cache' ;
Response.Text := HTTPClient.Get (TIdURI.URLEncode (URL)) ;

Problem is that more often than not, the returned file contains
errors. In
a 200k file, 2 or 3 characters are often munged. Occasionally I
manage to
receive the file without errors. Small files are OK.

How reliable is the HTTP protocol? Would it be more reliable to
redirect to
the target file from the ASP page. I say this because HTTP seems to
have no
problems getting .ZIP files or huge setup exe files.
HTTP is very reliable as you've allready identified. Your problem is
likely to be found because characters encoding is not configured properly.
We really need see the ASP code. Which characters are messup, characters
found in other parts of the XML or in the Base64 part. A common error in
sending XML from ASP is that the XML may be coming down as UTF-8 but the
content-type header does not specify UTF-8.

It would seem more sensible to fetch metadata if there is any as XML then
fetch the file in its raw format. Base64 creates bloat.

Another alternative if your client has the ability to access response
headers and the amount of metadata is small is to simply respond with the
file content and add any metadata need as custom headers to the response.
--
Anthony Jones - MVP ASP/ASP.NET
Nov 15 '07 #2
I'm sure the ASP output is arriving OK. The ASP that send the file
is:

var TextStream = LoadFileFSO.OpenTextFile (UserFilePath +
FileIDToLoad, ForReading) ;

while (! TextStream.AtEndOfStream)
{
Line = TextStream.readline () ;
Response.write (Line + "\r\n") ;
}
TextStream.Close () ;

At the suggestion of Gambit, I assigned the reponse to a stream
instead of a stringlist and that cured the problem. I have no idea
why it would make any difference but it has.

Ross McMillan
Nov 15 '07 #3

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

Similar topics

77
5622
by: nospam | last post by:
Reasons for a 3-tier achitecture for the WEB? (NOTE: I said, WEB, NOT WINDOWS. DON'T shoot your mouth off if you don't understand the difference.) I hear only one reason and that's to switch a...
4
1427
by: Biz | last post by:
I have an ASP form which collects data into a MS Access database. This is used to collect information from 120 of my students. Last year I used a free host but this was utterly unreliable. This...
34
6356
by: Ville Voipio | last post by:
I would need to make some high-reliability software running on Linux in an embedded system. Performance (or lack of it) is not an issue, reliability is. The piece of software is rather simple,...
4
1360
by: Wayne Aprato | last post by:
How does Access 2002 fit in to the reliability lineup of Access versions. Access 95 seemed to be fairly ordinary, Access 97 by all accounts was their best effort yet and Access 2000 seems to have...
20
3152
by: Joe Fallon | last post by:
My co-worker and I are debating Flexibility vs. Reliability. For example this method is highly flexible: Public Shared Function GetList(ByVal whereClause As String) As String strSQL = "SELECT...
4
1292
by: John Pote | last post by:
Hello, help/advice appreciated. Background: I am writing some web scripts in python to receive small amounts of data from remote sensors and store the data in a file. 50 to 100 bytes every 5 or...
41
2063
by: Carl J. Van Arsdall | last post by:
Hey everyone, I have a question about python threads. Before anyone goes further, this is not a debate about threads vs. processes, just a question. With that, are python threads reliable? Or...
0
7014
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7180
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,...
1
6905
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7395
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5485
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,...
1
4921
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...
0
3108
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3103
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
311
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.