Uploading local images thru FTP for remote publishing

It is a common need to upload local images to a remote hosting if you use this editor to a desktop composer for a BLOG or if you plan to publish the Editor content to a remote CMS.

In version 5.0, we have added a special method FTPUploadLocalImagesAndUpdateHtmlWithAbsoluteUrlsAsync(); it can be called as

winFormHtmlEditor1.Content.FTPUploadLocalImagesAndUpdateHtmlWithAbsoluteUrlsAsync();

If you call this method, the editor will upload all the local images to your FTP server asynchronously and once the upload is completed, this method will update the BodyHTML in such a way that, all images who had src attribute pointing to the local path would be changed to the new internet URL. Once this transformation is done, you can safely publish your content to your remote site.

Oh yes, before you call this method, of course you would need to setup your FTP settings and that can be done from the Property Editor in Visual Studio, the FTP settings are available under the Options composite property as shown here:

ftp_setting

As this method call is Asynchronous, you can optionally handle the Status_Changed event to get the upload progress and update your status bar in your application.

status_changed_event

Once you have setup the FTP Settings, and handled the StatusChanged event, you can add a button in your Windows form labelled "Upload to FTP". Also you may add a status label for displaying the upload progress. Now, lets follow the following Work Flow and you may grasp the idea about this special API.

step 1

step_two

step 3

step 5

step 6

Last updated on Sep 25, 2014