Click here to Skip to main content
11,924,995 members (58,087 online)
Click here to Skip to main content
Add your own
alternative version


9 bookmarked

How To Retrieve and Change FTP File Attributes by Using WinInet Functions.

, 31 Mar 2006
Rate this:
Please Sign up or sign in to vote.
An article about using the FTPCommand function to send direct commands to the FTP server.


There are several good articles on CodeProject containing different implementations of FTP Clients by using WinInet functions. But since WinInet FTP is limited by itself (provides only basic implementation of FTP protocol) these implementations also inherit these limitations.

For example, you cannot retrieve the file attributes or owner information and cannot change them by using WinInet functions.


Fortunately, starting with Internet Explorer 5.0 and later, you can use the FtpCommand function to send direct commands to the FTP Server and parse results by yourself.

In this example, I send “LIST” command to the FTP Server and use “D. J. Bernstein, to analyze results. I have modified the ftpparser a little for this article.

In this sample, I use only the “LIST” command. You can send any allowed command to the FTP server. For example, to change file permissions, you can send “SITE CHMOD ...”, to retrieve single file attributes/permissions you can use “STAT ...”, etc. Refer to RFC 959 to get more information about all possible FTP commands.


  • 31st March, 2006: Initial post


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

You may also be interested in...

Comments and Discussions

Generalfull script Pin
Devdsn29-Nov-14 1:07
memberDevdsn29-Nov-14 1:07 
GeneralA comfortable FTP class in .NET Pin
Elmue27-Aug-08 13:21
memberElmue27-Aug-08 13:21 
QuestionWinInet - Secure FTP? Pin
Chiew Heng Wah3-Apr-06 17:07
memberChiew Heng Wah3-Apr-06 17:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.151125.3 | Last Updated 31 Mar 2006
Article Copyright 2006 by pkhach
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid