vtiPutDocument

C++: long vtiPutDocument(LPCTSTR szFileName, LPCTSTR szURL,
             BOOL bBlockingRequest);
VB: vtiPutDocument(FileName as String, URL as String, 
          BlockingRequest as Integer) as Long

Description

Takes a file from the local file system and uploads it to the current web, using the authorization established for the Explorer’s user when the current web was opened. An error occurs if no web is currently open. After the document is uploaded, the FrontPage Server Extensions will expand any FrontPage components in the document, and regenerate any other documents that depend upon the one being uploaded. Finally, the FrontPage Explorer will refresh its views after all server-side updating has finished.

The uploaded document will overwrite any previous web document with the same name. If another user has modified that document since the web was opened or last refreshed, a dialog box will appear giving the user the opportunity to overwrite or preserve the old document. In general, you should use vtiIsPageInWeb to determine if this method would overwrite a particular document. Use vtiPutDocuments to upload several files at once.

This can be a blocking or non-blocking call depending on the BlockingRequest parameter. Currently there is no way to determine when a non-blocking request has completed.

Return Value

The return value is currently 1 for success and 0 for failure, but this may change to include other status codes in the future.

Parameters

FileName is the absolute path to a file on the local file system. It can be an ASCII or binary file. In Visual Basic, you typically place “App.Path” and “\” into a string before adding the name of a file in the current directory. Example: “C:\test\index.htm”.

URL is what you want the file to be named in your web. You can use “8.3” filenames to be safe; otherwise, you’ll need to use vtiGetWebMetaInfo to examine the filename conventions on the web server. The parameter can contain “/”characters to refer to web subdirectories, as long as they exist in the web. Valid subdirectories are “images” and “_private” or other user-created folders. Examples: “index.htm”, “images/logo.gif”.

BlockingRequest should normally be set True.