Configuring Java Powered FTP Uploads

From version 2.3, Pixaria includes a powerful Java applet from JFileUpload that allows you to transfer images to your website quickly and easily by FTP from within your web browser window.

Why a Java applet?

The browser based FTP applet has a number of major advantages over a conventional FTP client:

  1. Large images are automatically resized on your computer before being uploaded as both high-resolution and comping sized files.
  2. You don't need any special FTP software to transfer files - only a web browser on a computer with Java installed.
  3. The upload applet is embedded into the admin area of your website which means you can upload images from any computer that has internet access.

Purchasing and installing a license

To get started using the upload applet, you will first need to purchase a license for the upload applet and image filter software from the developer which will cost $39 US and enable unlimited use of the applet on your website.

Once you've purchased the software and received the license file, you need to place the applet license file (license.oxw) into the following directory on your server 'resources/ext/jclient/' to ensure that you are able to use all of the features of the registered software.

You will next need to edit the file 'resources/ext/jclient/scaling.properties' and add a new line at the top of the file to tell the applet where your license is:

You must use the full path to the license file:


regfile=/resources/ext/jclient/license.oxw

or like this:


regfile=/imagelibrary/resources/ext/jclient/license.oxw

Configuring Pixaria

Before you can use the upload applet you need to provide Pixaria with FTP login settings for your site. Because the FTP protocol provides read and write access to your server, it's very important that you consider the security implications for your site when you begin configuring FTP applet support in Pixaria.

Some important points to consider are:

  1. You should only allow the applet to have FTP rights for a single directory on your server (resources/javaupload/).
  2. You should create a separate FTP account for the applet to use and lock it to the 'javaupload' directory.
  3. You should be careful about who you grant admin rights to.

Configuring the applet settings

The Pixaria admin area now includes a link to 'Java FTP with resize' in the image library toolbar which you can see by clicking onto the upload images link under the content tab of the admin navigation.

If you've never configured the settings for the upload applet before, you will be prompted to enter details for:

  1. FTP address of your server
  2. Path to java upload directory
  3. FTP account username
  4. FTP account password

(If you've already entered settings for these items, then you can get to the settings form by clicking on the link to edit the settings.)

Let's go through these one at a time...

FTP address

The FTP address must be entered as a hostname or IP address but NOT as a URL.

All of the following are acceptable:


192.168.34.5
212.56.7.122
ftp.mysite.com

While the following are not allowed:


ftp://ftp.mysite.com/
ftp://212.56.7.122/
http://212.56.7.122

Path to java upload directory

When the FTP applet logs in to your server, it will need to know where to put the uploaded image files. In Pixaria, the FTP applet upload directory is called 'javaupload' and is located in the resources directory on your site.

If you've created a dedicated FTP account for the applet (recommended) and configured the home directory for the account to be '-/resources/javaupload/', then you can leave this field blank.

If however you're using a different FTP account that doesn't login at this location by default, you will need to enter the complete path from the path where the FTP client normally logs in to the location of the 'javaupload' directory. This could be something like:


httpdocs/pixaria/resources/javaupload/

OR


vhtdocs/resources/javaupload/

FTP account username and password

This is the username of the FTP account and the password to login. It is highly advisable to create a dedicated FTP account for the Java applet to use and configure it in such a way that the account does not have permission to see files outside of it's default login directory.

Most good hosting providers include FTP account creation tools in the web based control panels for their systems. For further assistance, contact your hosting provider.

Testing the applet

Once you've entered all the required settings, you should save them at which point you will be transferred to the applet viewer page. The Java applet should now load during which time you may be prompted to accept a security notice to grant the applet rights to access files on your computer.

If all has gone according to plan, the applet control will be displayed in the web page like this:

javaftp_01.jpg

How to upload files

Uploading images using the applet is as easy as drag and drop. You can select multiple JPEG image files for upload using the 'File' menu within the applet window itsel or simply drag them from the Finder (Mac) or an Explorer window (Windows).

Large images are automatically resized to comping size and the original and resized image are then uploaded to your server by FTP. Once the upload is complete, you can view a list of the uploaded files by clicking on the button at the bottom of the page. From the image view screen, follow the step by step instructions for importing the images into your image library as you would do with files uploaded in the normal way.

Troubleshooting

The FTP applet is a complex and poweful tool which should work with minimal configuration but occasionally things can go wrong.

The applet doesn't appear

If the applet doesn't display and you see a broken image icon or a red cross in the space where the applet should be, then you should check the following:

  1. The applet files with filenames ending in .jar are binary files similar to zip files and have to be uploaded by your FTP client in 'Binary' mode. Check the documentation for your FTP client and re-upload the files in binary mode. You may need to quit and restart your web browser to see the changes.
  2. The applet files included with Pixaria (see the image below) have all been uploaded to resources/ext/jclient/
  3. The .jar files have been uploaded in binary mode (they are a type of zip file).

javaftp_02.jpg

The applet gives a memory error

If you get errors about the applet running out of memory - as can happen when resizing very large images, you may need to increase the allowed memory allocation for Java applets.

On Windows, go to the Java control panel:


Start > Control Panel > Java > Java tab > Java plugin runtime > Display

And enter the value '-Xmx128m' (without quotes) in the 'Execution Parameters' field to increase the memory allocation to 128 MB.

On Mac OS X, launch the Java preferences application at:


/Applications/Utilities/Java/Java Preferences.app

Enter the value '-Xmx128m' (without quotes) in the 'Applet Runtime Parameters' field to increase the memory allocation to 128 MB.

Further help and documentation

For more information about problems with the applet, please consult the JFileUpload documentation and JImageFilter documentation.

Go back to contents

Created: Saturday, May 31, 2008
Last edited: Tuesday, July 8, 2008


image Pixaria Gallery Divestock