Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
While it's always best to work on local development environments when you're doing your day-to-day work, there's always comes a time when you to need to upload a file to a server. We can do this is in CF Builder by creating a synchronization connection between our projects and a remote FTP server. There's just a few simple steps to get things configured. To associate a project with an FTP connection, you simply need to right-click on the project, choose Synchronize and Create New Synchronize Connection. In the Site Connection dialog box, you provide a name for your connection. We'll leave it at the default, which is our project's name.
We choose the project that it's going to be connected to and then we can choose which type of server we want to associate with this project. So, our options are FTPS, FTP, another existing project shortcut, or SFTP. In this case, we're going to choose FTP. This'll bring up the new connection dialog box and we'll give our site a friendly name that we can reference. In this case, it's going to be server1. I can select my connection type, which, in this case, is FTP. I can change it if I had made the wrong selection in the previous dialog and then I'll provide my FTP details.
In this case, my server name is server1.sitedrivinc.com. My user name is cfbuilder and my password is top-secret. Then I'll click Test to make sure that the FTP connection actually works. We can see that the connection is succeeded. If there was a problem, it'd tell us what that problem was, so that we could correct it. Click OK and then I can choose the remote path. In my server's case, my remote path actually includes my user name.
Your server may or may not have this requirement. So, make sure that you have the proper remote path specified as defined by your host. So, you click on the Advanced Options and change the port number, use passive mode, or if you're having problems with the synchronize functionality not working correctly, you can calculate the server and client time offset. In this case, I don't need to change anything so I'll click OK and click OK once more. Now I can see that I have my project associated with my new server1 remote connection.
I'll click OK once more and if I look at my File view, I can see my new Project Shortcut is setup here. My FTP server that I've just defined is set up here. And in my Navigator view, I can now see I have these double arrows here that determine that there is a synchronization connection associated with this project. So, now how do we upload files? Well, in our Chapter 3 directory, let's create a new file to upload. I'll right-click, choose New > ColdFusion page, just call this index and we'll type some code in here, This is my test file.
I'll save that and to upload, I need to right-click on the file, choose Synchronize and Upload. When I click Upload, it's going to give me a message that says, "are you sure you want to upload this file?" It'll overwrite any items with identical names at the destination. This is the same warning you get when you upload a file through Dreamweaver. Basically, are you are you sure you want to do that? We'll click Yes and we can see that one item was uploaded and one folder was created because that Chapter 3 folder didn't exist on my remote site. I'll click OK.
And if I click on the Console view, I can actually see all of the FTP communication that happened with my remote server. So, if you are having problems with files not uploading correctly, you can look in the console and determine exactly what went wrong. Now you can also look at your remote site by going through the File view. If I click on the small arrow here next to my FTP server, I can see that Chapter 3 folder that I've uploaded and I can see the index.cfm file sitting on the remote server. I can also right-click here and take actions on that file, for example, if I want to delete it.
Let's go ahead and delete this file. It'll ask us, are we sure?, and you cannot undo this action. So make sure you really are sure. And I'll click Yes and that file has been removed. Now, one functionality that I've used a lot in Dreamweaver is actually synchronizing my local system up to my remote system. You can do that in CF Builder as well by right-clicking on any file or directory in your project, choose Synchronize and Synchronize again, and this brings up the Synchronization preview for your site.
I can see that I'm going to be synchronizing with server1 and here I can see my local system and my remote system. In this case, the index.cfm file is going to be created on server1. If I didn't want that file to be created, I can simply click the Skip check box and it will skip that file in the synchronization options. I do want this file to be uploaded so I'll uncheck that box. Under the View Options here, I can also determine how I want to see all of the resources that are going to be synchronized.
By default, it shows a flat view, but if I choose Tree, I can see the individual folders and all the files underneath those folders. I can also choose the Show Modification Dates. So, if I choose that option and I'll scroll over here to the right, I can see the local and remote times for files. Since this file isn't on the remote server, I don't have a remote time. Now down at the bottom, I can also choose to delete orphaned files. So, as an example, if I wanted any files not on the remote server to be deleted on my local system, I can check this box and you can see that the Chapter 3 index file is actually going to be deleted.
Let me scroll back over here so you can see that. So, since I don't want this file to be deleted, I'm going to uncheck that box. Now over here under Mode, if I expand this menu, I currently have it set to Sync, which means if the file is existed on the remote server, it will be downloaded and if a file existed on the local server, it would be uploaded. I can change this so that I'm only uploading or only downloading. I can also force all files up to the remote server even if they're older than the ones on the server and vice versa.
I can force all files down even if they're newer on my remote system. To continue through the dialog, the next section is the Cloud Team Comment. If you're using the cloud team functionality as part of Aptana, this will make sense to you and you can actually enter any comments in this dialog box. The last thing we'll take a look at is the Advanced Options. Under the Advanced Options, you can use a CRC check when files are less than a minute apart to make sure that they actually are different. This would take into account any slight time differences in between your local and remote server.
We can also have it do all of this work in the background for us so we can continue working on other things and we can set permissions on files if we're working on a remote server that supports that functionality. So, now I'm going to collapse the Advanced Options and since I'm all ready to go, I'll click Start Sync. ColdFusion Builder then uploads, deletes, overwrites, does whatever it needs to do to get everything at the sync and then tells me that everything is taken care of. So, I'll click Close, go back over here to my FTP site and we'll just expand this to make sure that it did indeed upload my index.cfm file.
So, you should now be able to hookup any project to an FTP site and get your new creations published quickly.
Get unlimited access to all courses for just $25/month.Become a member
82 Video lessons · 103228 Viewers
61 Video lessons · 89962 Viewers
71 Video lessons · 73537 Viewers
56 Video lessons · 105080 Viewers
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.
Your file was successfully uploaded.