Controlling URLs For Image Uploads

EditLive! includes the ability to automatically upload local images and when it does, the URL is changed to point to the new version on the server. The simplest way to control the resulting URL is to adjust the base attribute of the httpUpload element in your configuration file. When EditLive! uploads an image it simply appends the image name to the base you provide. So if the base is http://example.com/images/ and the image name is bob.jpg the resulting URL is http://example.com/images/bob.jpg

Sometimes though you need to change the directory or image name to avoid file conflicts or to better organize the image library (eg a folder for each page or each user). In those cases the image upload script can take control of generating the URL itself and simply pass it back to EditLive! All that's required is for the upload script to return only the URL to use on a single line. The URL can be absolute or relative - it will be used exactly as is by EditLive! so it needs to be correctly URL encoded. EditLive! will then ignore the base attribute and use the URL exactly as it was returned by the upload script.