Re: Opentextfile TriStateMixed
- From: "mayayana" <mayaXXyana@xxxxxxxxx>
- Date: Fri, 19 Dec 2008 00:29:15 -0500
I am using the iNet control to get the files. The getHeader function says
it's only good for HTTP Not FTP?
I've never used that. It might be worth testing getHeader,
though. If it doesn't work you might also try using HTTP. I don't
really know exactly what the difference is between the
two. It may just be a matter of different commands, etc.
I find that if I use winsock and talk directly to an FTP server,
I seem to have no trouble sending:
"GET " & FilePath & " HTTP/1.0"
The FTP server just sends the file to me with an HTTP
header.
Looking at the Execute method docs it looks like that
works similarly, using the same method for HTTP or FTP,
and just leaving it to you to send an appropriate request
string.
objFTP.Execute , "GET " & Chr(34) & strStories(i) & Chr(34) & " " &strFile
"The GetHeader method is used to retrieve header text from an HTTP file"
I'll keep trying...
Thanks for the help.
-Lou
"mayayana" <mayaXXyana@xxxxxxxxx> wrote in message
news:en0XpvRYJHA.2280@xxxxxxxxxxxxxxxxxxxxxxx
You didn't say how you're getting the file fromAnother thought with this: I think that scripters
FTP. Given that you're using FSO and ADODB it sounds
like you've adapted your code from VBScript. But if
you're carrying out the server conversation yourself
then you should get the file type as part of the header.
Example:
Content-Type: text/plain; charset=UTF-8
sometimes use msxmlx.dll (where x is a number)
to download files. I've never tried msxml and don't
know much about it, but I took a quick look and --
unlike the commonly used IE library functions like
URLDownloadToFile -- it seems to have functions like
GetResponseHeader, to return the server response.
The server sends this header prepended to the
requested file. It's a lot like an email header -- similar
format with lots of possible fields, many of which
are not critical. Here's part of one:
Server response: 200 - OK
Server Header: HTTP/1.1 200 OK
Date: Thu, 18 Dec 2008 03:57:02 GMT
Content-Language: en-US
Content-Type: text/html; charset=UTF-8
The server tells you the result of your request.
In this case it's 200, meaning "OK. Valid request.
Here comes the whole thing."
It might be feasible to get that header, search for
what comes between "charset" and a return, then if
it's not found assume UTF8. (I'm not certain, but I
think that has become the default these days.)
I also don't know how common msxml is. The methods
above apparently require v. 3+. But I'm on Win98SE, with
the original IE version, and I have both v.3 and v.4 installed,
so I guess msxml must be fairly ubiquitous.
.
- Follow-Ups:
- Re: Opentextfile TriStateMixed
- From: Bob Butler
- Re: Opentextfile TriStateMixed
- References:
- Opentextfile TriStateMixed
- From: Lou
- Re: Opentextfile TriStateMixed
- From: expvb
- Re: Opentextfile TriStateMixed
- From: Lou
- Re: Opentextfile TriStateMixed
- From: mayayana
- Re: Opentextfile TriStateMixed
- From: mayayana
- Re: Opentextfile TriStateMixed
- From: Lou
- Opentextfile TriStateMixed
- Prev by Date: Re: How to add file to project
- Next by Date: Re: Faster Combobox loading
- Previous by thread: Re: Opentextfile TriStateMixed
- Next by thread: Re: Opentextfile TriStateMixed
- Index(es):
Relevant Pages
|