Author Topic

Jérôme Vieilledent

Saturday 27 June 2009 3:22:25 am

Comment51399

Hi Thibault.

First, know that it already exists extensions to import data (<b>Data Import</b>, and I'm about to release mine, <b>NovenImportXMLStream</b>).

Now for your question, you should use the <i>fromString()</i> method of the <i>ezimage</i> datatype. Every datatypes (well at least the built-in ones) have this very useful method since Exponential 3.9.
So if you want to grab an external image, you must first grab it in a temporary folder on your local filesystem (in your <b>var/</b> directory for instance, check your <b>VarDir</b> directive in site.ini), and then you pass the full path (use <b>realpath</b> PHP function) of your image to the <i>fromString()</i> method.