DekGenius.com
Previous Section Next Section

6.8 Updating Your Site

Dreamweaver 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 force the Dependent Files request dialog to reappear, hold down the Alt key (Windows) or Opt key (Macintosh) when you transfer a file. Under Edit figs/U2192.gif Preferences figs/U2192.gif Site figs/U2192.gif Dependent Files, configure the Prompt on Get/Check Out and Prompt on Put/Check In options to change this setting permanently.

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 figs/U2192.gif Preferences figs/U2192.gif Site figs/U2192.gif 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).

If Dreamweaver has trouble connecting to the remote server and transferring files at the expected speed, restart Dreamweaver and try again.

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.

If File Check In/Check Out is enabled, use Check Out to download files for editing; use Get to download files that you don't intend to edit. Use Check In to upload revised files (use Site figs/U2192.gif Undo Check Out to relinquish control over a file without editing it); don't use Put to upload files when File Check In/Check Out is enabled. When File Check In/Check Out is disabled, use Get to download files and Put to upload files. Avoid manually dragging files between the Remote Files and Local Files panes.

6.8.1 Get, Download, and Check Out

Here 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):

Drag files from the Remote Files pane to the Local Files pane

This method isn't recommended. For one thing, you can easily drag and drop files into the wrong folder, leading to duplicated files or overwriting another file of the same name. Furthermore, it doesn't check out the file for editing even when File Check In/Check Out is enabled. The reference (oldest) copy of a file always resides on the server. Therefore, if you try to copy an older file from the server over a new version on the local folder, Dreamweaver asks, "Do you wish to overwrite your local copy of index.html?" (This message would be better if it emphasized that you may overwrite a newer file in the local folder.)

Select files in either the Remote Files or Local Files pane and use Get

There are numerous ways to execute the Get command. In Windows you can choose Site figs/U2192.gif Get in the Site window or Ctrl+Shift+D. On the Macintosh you can choose Site figs/U2192.gif Site Files View figs/U2192.gif Get or Cmd+Shift+D. On either platform you can use the Get button in the Site window toolbar or the Get command in the pop-up contextual menu.

The Get command always downloads files from the remote site to the local site, even if you selected files in the Local Files pane. Get doesn't check out files even if File Check In/Check Out is enabled. Use Get to download files when File Check In/Check Out is disabled or when you want to download a file without editing it.

Select files in either the Remote Files or Local Files pane and use Check Out

This option is available only if File Check In/Check Out is enabled. There are numerous ways to check out files, such as using the Check Out button in the Site window toolbar or the Check Out command in the pop-up contextual menu. Using Check Out automatically downloads files from the remote site to the local site, even if you selected files in the Local Files pane. Use Check Out instead of Get if File Check In/Check Out is enabled and you want to edit a file.

If the Check Out Files when Opening option is enabled (see Figure 6-3), opening a locked file will check it out for editing.

After downloading files, be sure that you are seeing the latest version by using Shift+F5 to refresh the Local Files pane.

6.8.2 Put, Upload, and Check In

You 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:

Dragging files from the Locate Files pane to the Remote Files pane

This method isn't recommended. For one thing, you can easily drag and drop files into the wrong folder, leading to duplicated files or overwriting another file of the same name. Furthermore, it doesn't check in the file even when File Check In/Check Out is enabled. The reference (oldest) copy of a file always resides on the server. Therefore, if you try to copy an older file from the local folder over a newer version on the remote site, Dreamweaver asks, "Index.html is newer on the remote server. Do you wish to overwrite it?"

Selecting files in either the Remote Files or Local Files pane and using Put

There are numerous ways to execute the Put command. In Windows you can choose Site figs/U2192.gif Put in the Site window or Ctrl+Shift+U. On the Macintosh you can choose Site figs/U2192.gif Site Files View figs/U2192.gif Put or Cmd+Shift+U. On either platform you can use the Put button in the Site window toolbar or the Put command in the pop-up contextual menu.

The Put command always uploads files from the local site to the remote site, even if you selected files in the Remote Files pane. Put doesn't check in files even if File Check In/Check Out is enabled, so it is useful to submit updates while retaining owenership of a checked-out file. Use Put to upload files when File Check In/Check Out is disabled.

Selecting files in either the Remote Files or Local Files pane and using Check In

This option is available only if File Check In/Check Out is enabled. There are numerous ways to check in files, such as using the Check In button in the Site window toolbar or the Check In command in the pop-up contextual menu. Using Check In automatically uploads files from the local site to the remote site, even if you selected files in the Remote Files pane. Use Check In instead of Put when File Check In/Check Out is enabled if you want to submit revisions and relinquish control of a file.

After uploading files, be sure that you are seeing the latest version by using Alt+F5 (Windows) or Opt+F5 (Macintosh) to refresh the Remote Files pane. After uploading files, test the entire site thoroughly and fix any broken links or missing files.

6.8.3 Finding, Selecting, and Transferring Files

There 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:

  • Select a file in the Local Files pane and choose Locate in Remote Site from the contextual menu or the Edit menu in the Site window.

  • Select a file in the Remote Files pane and choose Locate in Local Site from the contextual menu or the Edit menu in the Site window.

  • When using Windows, use the Select Newer Local, Select Newer Remote, or Select Checked Out Files options under the Edit menu in the Site window. On the Macintosh these options appear under the Site figs/U2192.gif Site Files View menu. (When you select files in the Site Map pane, Windows also offers the Edit figs/U2192.gif Invert Selection option in the Site window.)

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 Files

Dreamweaver can automatically select revised files to be uploaded. Chose Edit figs/U2192.gif Select Newer Local in the Site window (Windows) or Site figs/U2192.gif Site Files View figs/U2192.gif 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 figs/U2192.gif Select Newer Remote in the Site window (Windows) or Site figs/U2192.gif Site Files View figs/U2192.gif 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 figs/U2192.gif Synchronize.

Figure 6-16. The Synchronize Files dialog box
figs/dwn_0616.gif

The values available for the Synchronize option in this dialog box are:

Entire Site

Synchronizes all files (including orphaned files), whether selected or not

Selected Local Files Only

Synchronizes the files selected in the Local Files pane only (available only when the Local Files pane is active)

Selected Remote Files Only

Synchronizes the files selected in the Remote Files pane only (available only when the Remote Files pane is active)

The values available for the Direction option in this dialog box are:

Put newer files to remote

Uploads files that are newer on the local machine to the remote server. It does not download any files from the remote server to the local machine.

Get newer files from remote

Downloads files that are newer on the remote server to the local machine. It does not upload any files from the local machine to the remote server.

Get and put newer files

Downloads newer files from the remote server and uploads newer files to the remote server so that both the remote and local machines have the latest version of all specified files.

If you have a server-side script or application that generates pages automatically, do not check the Delete Remote Files Not On Local Drive option; it removes any files on the remote server for which there is no corresponding file on the local machine.

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 box
figs/dwn_0617.gif

Files 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 figs/U2192.gif Site FTP Log in the Site window (Windows) or Site figs/U2192.gif 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.

    Previous Section Next Section