Forums / Developer / Obtaining Image original filename full path

Obtaining Image original filename full path

Author Message

Rich R

Monday 06 December 2010 9:51:46 am

Hi,

Im having trouble obtaining the full path of the original file which is uploaded in a Image object.

I can obtain the paths of each image size via $node.data_map.image.content.IMAGE_SIZE however not for the original file uploaded, I seem to only be able to obtain the name.

Any advice appreciated, thanks!

Ivo Lukac

Monday 06 December 2010 10:31:12 am

Hi Rich,

Try with image alias 'original' instead of IMAGE_SIZE

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

Lo' F.

Monday 06 December 2010 10:32:18 am

...How about if you try with this?

{$node.data_map.image.content[original].full_path|ezroot()}

loredanaebook.it

Rich R

Tuesday 07 December 2010 2:42:45 am

Thank you. However what I after is the very original image that was uploaded into eZ. The filename as stored in original_filename. For example if I upload a tiff file, eZ creates a jpg of it which is stored as the "original" image size. However I am after the full location of the tiff that I uploaded.

Lo' F.

Tuesday 07 December 2010 7:29:51 am

Hi Rich.

It seems that when an image is uploaded in an image object, it is manipulated and stored in the filesystem with the name of the main object as there is no track of the file as uploaded nowhere in the folders (at least I could not find it..)

I have been searching for an attribute returning the original file path ..

{$node.data_map.image|attribute(show)}

but all I have been able to get is, like you said, the original file name..

{$node.data_map.image[content][original_filename]}

..or the original (but renamed) image file path.

p.s. sorry for the "inappropriate" above, Ivo! I hit the touch-pad by mistake..!

loredanaebook.it

Rich R

Thursday 09 December 2010 3:28:56 am

Hi Lo' F.,

Thank you for your efforts.

Indeed, there is no reference to the path of the real original in the node. I also have a feeling that eZ discards of this file as greping for original_filename in var does not always yield results.