Re: Opentextfile TriStateMixed




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 from
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

Another thought with this: I think that scripters
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.






.



Relevant Pages

  • Re: uploading problems
    ... You have corrupted the extensions by using FTP, have your re-install them, then do not use FTP. ... FrontPage Resources, WebCircle, MS KB Quick Links, etc. ... > I uploaded with http in FP. ... FTP breaks the server ...
    (microsoft.public.frontpage.client)
  • Re: why use ftp if http provides the same services???
    ... >> when downloading a file often the websites give two option..either ... >> download it from a ftp site or http.. ... >> html.eg.word,spreadsheet file) from http server and ftp server.? ...
    (comp.lang.java.programmer)
  • Re: is that a good offer for a server installation?
    ... > customers to be downloaded and then worked. ... buying a server to mantain in his office ... http itself has no more security then ftp travel ...
    (comp.os.linux.networking)
  • Re: HTTP FS?
    ... FTP is a way to do it, but not HTTP. ... I don't want my HTTP archive be public, neither in file listings nor in ... To give the server a clue, ...
    (comp.os.minix)
  • Re: Opentextfile TriStateMixed
    ... it's only good for HTTP Not FTP? ... "The GetHeader method is used to retrieve header text from an HTTP file" ... to return the server response. ...
    (microsoft.public.vb.general.discussion)