Discussion:
[VC++ 6.0]How to get directory listing on http site with wininet
(too old to reply)
echa
2004-09-16 10:57:02 UTC
Permalink
I'm using wininet in VC++ 6.0

I would like to get the files listing of a specified directory on a Http site.

Thank you.
Brian Cryer
2004-09-16 13:53:04 UTC
Permalink
Post by echa
I'm using wininet in VC++ 6.0
I would like to get the files listing of a specified directory on a Http site.
Thank you.
As far as I am aware you can't list files from an HTTP site. You get the
appearance that you can when browsing sometimes but this is because the HTTP
server is set up to give a file listing when it hasn't got a specific file
to serve up.

You can get the listing of the files on an FTP server (not HTTP) using
WinInet. There is an example (quite simple) in Delphi at
http://www.cryer.co.uk/brian/delphi/wininet/example_findfirstnextfile.htm,
which returns all the files in the folder as a simple concatinated string.
You just need to ensure a call to FtpSetCurrentDirectory before using the
example.

regards,

Brian Cryer.
echa
2004-09-16 15:03:03 UTC
Permalink
Thanks for your answer Brian.

echa.
Post by Brian Cryer
Post by echa
I'm using wininet in VC++ 6.0
I would like to get the files listing of a specified directory on a Http
site.
Post by echa
Thank you.
As far as I am aware you can't list files from an HTTP site. You get the
appearance that you can when browsing sometimes but this is because the HTTP
server is set up to give a file listing when it hasn't got a specific file
to serve up.
You can get the listing of the files on an FTP server (not HTTP) using
WinInet. There is an example (quite simple) in Delphi at
http://www.cryer.co.uk/brian/delphi/wininet/example_findfirstnextfile.htm,
which returns all the files in the folder as a simple concatinated string.
You just need to ensure a call to FtpSetCurrentDirectory before using the
example.
regards,
Brian Cryer.
Loading...