6.8 Updating Your SiteDreamweaver has several options for synchronizing the local and remote versions of your site (both uploading to and downloading from the remote server). The Remote Files pane in the Site window shows the remote version of your site and the Local Files pane shows the local version. Files can be transferred manually in either direction or synchronized automatically based on the file dates. The first time you upload your site, be sure to upload all documents, images, and scripts used to create the web pages. After that, you need to upload only the documents that have changed. When you Get (download) or Put (upload) files, Dreamweaver ordinarily asks if it should include all dependent files (such as GIFs and JPEGs). If you enable the Don't Ask Me Again checkbox and click Yes, Dreamweaver always copies the dependent files between the local folder and remote server. This copying slows uploads and downloads dramatically.
To upload your file to a remote site, you must connect to the server specified under the Remote Info category of the Site Definition dialog box (as described earlier in this chapter). Configure the server options, often an FTP server, before proceeding. Test your connection using the Connect to Remote Host button in the Site window toolbar, as seen in Figure 6-11. (You can practice using the Remote Files pane even without FTP access. Simply choose Local/Network access and set up a folder on your local drive to act as a dummy remote site.) Dreamweaver automatically disconnects from a remote site after 30 minutes of inactivity. You can change this timeout setting under Edit Preferences Site Minutes Idle (some web servers may disconnect you before the specified time). In my experience, Dreamweaver may have difficulty reconnecting to a server after disconnecting due to inactivity (the problem doesn't occur when using the Disconnect button manually).
Earlier in this chapter, in Section 6.6.1, we learned how to download an entire remote site. But that one-time operation is unusual; more typically, you'll either download or upload selected files only. The next few sections explain the different ways to transfer files between the local folder and remote site. FTP operations tie up Dreamweaver, which prevents you from using it during large files transfers. Click the Stop Current Tasks icon in the lower-right corner of the Site Window to interrupt a transfer. There are so many ways to sling files around in Dreamweaver's Site window that it is easy to get confused, especially when using the File Check In/Check Out feature.
6.8.1 Get, Download, and Check OutHere are some ways that you can download files from the server (i.e., copy files from the Remote Files pane to the Local Files pane):
If the Check Out Files when Opening option is enabled (see Figure 6-3), opening a locked file will check it out for editing.
6.8.2 Put, Upload, and Check InYou can also upload files to the server (i.e., copy files from the Local Files pane to the Remote Files pane) in several different ways, including:
6.8.3 Finding, Selecting, and Transferring FilesThere are several ways to find and select files in the Remote Files and Local Files panes. Earlier, we saw ways to select files manually. The following methods rely on Dreamweaver to select the files for us based on some criterion:
You can transfer the selected files between the Remote Files and Local Files panes using the methods described in the preceding sections. For example, to upload an entire web site, you could click on the local root folder in the Local Files pane of the Site window and then use the Put button to post (upload) the files to the server. 6.8.4 Synchronizing FilesDreamweaver can automatically select revised files to be uploaded. Chose Edit Select Newer Local in the Site window (Windows) or Site Site Files View Select Newer Local (Macintosh) and Dreamweaver will automatically compare the file dates and times between the local and remote server, selecting only the files that are newer on the local computer. Once the selections are made, click the Check In button to upload files (if File Check In/Check Out is disabled, use the Put button to upload files instead). Conversely, sometimes you want to make sure you have the latest files from the remote server when working on your local copy of the site. Chose Edit Select Newer Remote in the Site window (Windows) or Site Site Files View Select Newer Remote (Macintosh) and Dreamweaver will dutifully select only the files that are newer on the remote server. Click the Get button to download the newer files to your computer (if the File Check In/Check Out feature is enabled and you want to edit the files, use the Check Out option instead). The Select Newer Remote option is useful for downloading files that were updated by an automated server-side application or by other developers in your workgroup. You can also automatically synchronize the remote and local sites to ensure that they both have the latest files. To open the Synchronize Files dialog box shown in Figure 6-16, select Site Synchronize. Figure 6-16. The Synchronize Files dialog boxThe values available for the Synchronize option in this dialog box are:
The values available for the Direction option in this dialog box are:
Once these selections have been made, click Preview to get a list of the pages that will be affected by the synchronization process. The Synchronize Preview dialog box, shown in Figure 6-17, displays the files to be synchronized. Figure 6-17. The Synchronize Preview dialog boxFiles to be uploaded are indicated by a Put checkbox in the Action column. Files to be downloaded are indicated by a Get checkbox in the same column. You can uncheck the checkboxes to selectively omit files from the transfer. Click OK to initiate the file transfer. You can interrupt the file transfer using the Stop Current Task button that appears in the dialog box while Dreamweaver synchronizes files. When the file transfer is complete, click the Save Log button that appears to save a Log file detailing the files transferred. See Section 6.6.1 earlier in this chapter for important details on the Synchronization option. If you are having trouble with FTP transfers, you can view the FTP log file by using Window Site FTP Log in the Site window (Windows) or Site FTP Log (Macintosh). The log file error messages may be somewhat cryptic. For example, if you've exceeded your disk space quota on the remote server, the log may display a generic failure message, such as "Cannot Put File," indicating that the upload failed but not giving the specific reason. |