How To use an external image

Hi all,

I have to use more images (that,sometimes,will be saved in another server for a backup),
so I wouldn’t save them into the db to avoid having to sincronize and manage them twice.
By this need,I’ve tried to use the html to point directly on the image() but without results.

My question is:
Using the html,does exist a way to point to an external image?

if not:
Does exist another way to do this?

Thanks in advance,

Marco

Marco R.:
I’ve tried to use the html to point directly on the image()

Try this:

<html><body><img src = 'file:///C:/myImage.jpg'></body></html>

are we talking here about a smart client? and then the c:\ where you talk about is the c: drive of the smart client? (so not a server or developer drive?)

@Joas:

It works,Thanks Joas!

@jcompagner:
Yes is the c: drive of smart client(for now I need only to choose the way that I have to take)

For who is reading this topic:
I have token another way because I have to work both with local and with remote files…I have token the related JSFile of myImage.jpg(using convertToRemoteJSFile) and I have convert it into a JSImage object by the code:

var _file = plugins.file.convertToRemoteJSFile('/site_off.jpg')	 	
plugins.images.getImage(_file.getBytes())

After this I have resized the JSImage to create a miniature.

I have a new question: what is the best way to send the new miniature-image to the remote folder(/uploads)?
At now I’m using:

plugins.file.writeFile('c:/mymini.jpg',_image.getData())
	var _newFile = plugins.file.createFile('c:/mymini.jpg')
	plugins.file.streamFilesToServer(_newFile,'/mymini.jpg',null)
	plugins.file.deleteFile('mymini.jpg')

But I like to jump the “writeFile” passage and stream the new miniature directly on the server…
My problem is that the miniature is a JSImage object…How can I convert it into a JSFile without write it first?

Create a temp file on the client, write the JSImage to that, then stream the temp file. The important code bits:

var image =  plugins.images.getImage(file.getBytes())
// insert: do something with the image like resize it
var temp = plugins.file.createTempFile(file.getName(), "jpg")
plugins.file.writeFile(temp, image.getData())		
var serverImages = [baseDirectory + directory + "/" + file.getName()]
var monitor = plugins.file.streamFilesToServer([temp], serverImages, IMAGE_import_callback)