FrontPage API

J

Jim Carlock

Does anyone know where to look to code for connecting to FrontPage
servers? Looking for information about the API to connect to a server
and upload and download from such server.
 
S

Steve Easton

Jim,
Need a little more info on exactly what you need to do.
There are no "FrontPage" servers per se. There are windows servers, apache servers etc that are
configured with FrontPage extensions.

As for publishing to / from an extended server, simply open FrontPage, then open the desired web,
click File > Publish Web.. and select the location / destination you want to publish to.

Note: in FrontPage 2003 the web you open is always the "Local web" regardless of where it lives,
the destination is always the "Remote web."

If you open the web on your drive, it is local and the server is remote.
If you open the web on the server, it is local and your drive is remote.

hth

--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 
J

Jim Carlock

Hi Steve. Thanks for the response.

I was looking more for the API. I've got the following code working
and I notice it needs to connect to two files:
1) FrontPg.exe
2) fpeditax.dll

They're both ActiveX components, both have a GUID.

The exported objects...
1) FrontPage // I'm using this one
2) Application
3) WebEx // I'm using this one

provide a means to connect. So what I really want to do is avoid
using those files and connect via an FTP mechanism. I think it connects
and communicates in a similar manner to FTP, but perhaps with it's own
set of network instructions. I haven't actually looked at the packets that
are sent across the network yet.

Option Explicit

Private WithEvents fpw As FrontPage.WebEx
Private msURL As String
Private msUID As String
Private msPW As String

Private Sub cmdConnect_Click()
Set fpw = FrontPage.Application.Webs.Open(msURL, msUID, msPW, fpOpenNoWindow)
'Call MsgBox(TypeName(VarType(fpw.AllFiles.Count)))
miFiles = fpw.AllFiles.Count
miFolders = fpw.AllFolders.Count
txtFiles.Text = CStr(miFiles)
txtFolders.Text = CStr(miFolders)
End Sub

Private Sub Form_Load()
msURL = "http://www.duhdumwebsite .com"
msUID = "MyUID"
msPW = "MyPassword" '<g> I hope that server nay uses these
End Sub

That was done outside of FrontPage in a VB6 application connected to
FrontPg.exe. I was originally wanting to know if there are some API calls
to do what I'm doing... and then I zoomed in on the type library and found
I can create a type library file that'll work. I probably can get the API
declarations done, but now I don't want the API anymore. I'm wanting to
know the set of commands send by the FrontPage client when connecting
to the server and use winsock or some wininet API to do this.

Now, maybe capturing the packets and looking at the sets of instructions
being passed between FrontPage and the server? Is it much like FTP
commands? Hmmm, maybe telnet to it?

--
Jim Carlock
Please post replies to newsgroup.

Jim,
Need a little more info on exactly what you need to do.
There are no "FrontPage" servers per se. There are windows servers, apache
servers etc that are configured with FrontPage extensions.

As for publishing to / from an extended server, simply open FrontPage, then
open the desired web, click File > Publish Web.. and select the location /
destination you want to publish to.

Note: in FrontPage 2003 the web you open is always the "Local web"
regardless of where it lives, the destination is always the "Remote web."

If you open the web on your drive, it is local and the server is remote.
If you open the web on the server, it is local and your drive is remote.

hth

--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 
S

Steve Easton

Ok.

FrontPage uses the connection info / mechanism used by Internet Explorer.
here is some text right out of MSDN for Visual Studio 6:
Starting an FTP Session
The application establishes an ftp session by calling InternetConnect on a handle created by
InternetOpen. InternetConnect needs the server name, ftp port number, user name, password, and
service type (which must be set to INTERNET_SERVICE_FTP). For passive ftp semantics, the application
must also set the INTERNET_FLAG_PASSIVE flag.

The INTERNET_DEFAULT_FTP_PORT and INTERNET_INVALID_PORT_NUMBER values can be used for the ftp port
number. INTERNET_DEFAULT_FTP_PORT uses the default ftp port, but the service type still must be set.
INTERNET_INVALID_PORT_NUMBER uses the default value for the indicated service type.

The values for the user name and password can be set to NULL. If both values are set to NULL,
InternetConnect uses "anonymous" for the user name, and the user's e-mail address for the password.
If only the password is set to NULL, the user name passed to InternetConnect is used for the user
name, and an empty string is used for the password. If neither value is NULL, the user name and
password given to InternetConnect are used.

Enumerating Directories
Enumeration of a directory on an ftp server requires the creation of a handle by FtpFindFirstFile.
This handle is a branch of the ftp session handle created by InternetConnect. FtpFindFirstFile
locates the first file or directory on the server and returns it in a WIN32_FIND_DATA structure.
Use InternetFindNextFile until it returns ERROR_NO_MORE_FILES. This method finds all subsequent
files and directories on the server. For more information on InternetFindNextFile, see Finding the
Next File.

To determine if the file retrieved by FtpFindFirstFile or InternetFindNextFile is a directory, check
the dwFileAttributes member of the WIN32_FIND_DATA structure to see if it is equal to
FILE_ATTRIBUTE_DIRECTORY.

If the application makes changes on the ftp server or if the ftp server changes frequently, the
INTERNET_FLAG_NO_CACHE_WRITE and INTERNET_FLAG_RELOAD flags should be set in FtpFindFirstFile. These
flags ensure that the directory information being retrieved from the ftp server is current.

After the application completes the directory enumeration, the application must make a call to
InternetCloseHandle on the handle created by FtpFindFirstFile. Until that handle is closed, the
application cannot call FtpFindFirstFile again on the session handle created by InternetConnect. If
a call to FtpFindFirstFile is made on the same session handle before the previous call to the same
function is closed, the function fails, returning ERROR_FTP_TRANSFER_IN_PROGRESS.

The following example displays the contents of an ftp directory in the IDC_FTPList list box. The
HINTERNET handle hSecondary is returned by the InternetConnect function after it establishes an ftp
session.

int WINAPI DisplayDir(HWND hX, DWORD dwFlags)
{
WIN32_FIND_DATA pDirInfo;
HINTERNET hDir;
DWORD dError;
char DirList[MAX_PATH];
DWORD dwTemp=MAX_PATH;
LPDWORD temp =&dwTemp;
LPVOID lpOption;
DWORD dwSize;
LPDWORD lpdwSize = &dwSize;

SendDlgItemMessage(hX,IDC_FTPList,LB_RESETCONTENT,0,0);
if ( !(hDir = FtpFindFirstFile (hSecondary, TEXT ("*.*"), &pDirInfo,
dwFlags, 0) ))
if (GetLastError() == ERROR_NO_MORE_FILES)
{
MessageBox(hX,"There are no files here!!!","Display Dir",MB_OK);
InternetCloseHandle(hDir);
return 1;
}
else
{
ErrorOut (hX, GetLastError (), "FindFirst error: ");
InternetCloseHandle(hDir);
return 0;
}

sprintf(DirList, pDirInfo.cFileName);
if (pDirInfo.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY)
strcat(DirList," <DIR> ");

SendDlgItemMessage(hX,IDC_FTPList,LB_ADDSTRING,0,(LPARAM)DirList);

dError = NO_ERROR;
do
{
if (!InternetFindNextFile (hDir, &pDirInfo))
{
dError = GetLastError();
if ( dError == ERROR_NO_MORE_FILES )
{
InternetCloseHandle(hDir);
return 1;
}
else
{
ErrorOut (hX,GetLastError(), "InternetFindNextFile");
InternetCloseHandle(hDir);
return 0;
}
}
else
{
sprintf(DirList, pDirInfo.cFileName);
if (pDirInfo.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY)
strcat(DirList," <DIR> ");
SendDlgItemMessage(hX,IDC_FTPList,LB_ADDSTRING,0,
(LPARAM)DirList);
}
}
while ( TRUE);

if (!InternetCloseHandle(hDir) )
{
InternetCloseHandle(hDir);
ErrorOut (hX,GetLastError(), "InternetCloseHandle error");
return 0;
}
else
return 1;

}




hth

--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer

Jim Carlock said:
Hi Steve. Thanks for the response.

I was looking more for the API. I've got the following code working
and I notice it needs to connect to two files:
1) FrontPg.exe
2) fpeditax.dll

They're both ActiveX components, both have a GUID.

The exported objects...
1) FrontPage // I'm using this one
2) Application
3) WebEx // I'm using this one

provide a means to connect. So what I really want to do is avoid
using those files and connect via an FTP mechanism. I think it connects
and communicates in a similar manner to FTP, but perhaps with it's own
set of network instructions. I haven't actually looked at the packets that
are sent across the network yet.

Option Explicit

Private WithEvents fpw As FrontPage.WebEx
Private msURL As String
Private msUID As String
Private msPW As String

Private Sub cmdConnect_Click()
Set fpw = FrontPage.Application.Webs.Open(msURL, msUID, msPW, fpOpenNoWindow)
'Call MsgBox(TypeName(VarType(fpw.AllFiles.Count)))
miFiles = fpw.AllFiles.Count
miFolders = fpw.AllFolders.Count
txtFiles.Text = CStr(miFiles)
txtFolders.Text = CStr(miFolders)
End Sub

Private Sub Form_Load()
msURL = "http://www.duhdumwebsite .com"
msUID = "MyUID"
msPW = "MyPassword" '<g> I hope that server nay uses these
End Sub

That was done outside of FrontPage in a VB6 application connected to
FrontPg.exe. I was originally wanting to know if there are some API calls
to do what I'm doing... and then I zoomed in on the type library and found
I can create a type library file that'll work. I probably can get the API
declarations done, but now I don't want the API anymore. I'm wanting to
know the set of commands send by the FrontPage client when connecting
to the server and use winsock or some wininet API to do this.

Now, maybe capturing the packets and looking at the sets of instructions
being passed between FrontPage and the server? Is it much like FTP
commands? Hmmm, maybe telnet to it?

--
Jim Carlock
Please post replies to newsgroup.

Jim,
Need a little more info on exactly what you need to do.
There are no "FrontPage" servers per se. There are windows servers, apache
servers etc that are configured with FrontPage extensions.

As for publishing to / from an extended server, simply open FrontPage, then
open the desired web, click File > Publish Web.. and select the location /
destination you want to publish to.

Note: in FrontPage 2003 the web you open is always the "Local web"
regardless of where it lives, the destination is always the "Remote web."

If you open the web on your drive, it is local and the server is remote.
If you open the web on the server, it is local and your drive is remote.

hth

--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
.......................with a computer
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top