cancel
Showing results for 
Search instead for 
Did you mean: 

Get file size

dvc
Champ in-the-making
Champ in-the-making
Hello!!

I need to obtain the file size and file type of for example an image. The file type is not problem, is the extension and with a switch or if instruction I can put the information but I don't know how I can obtain the size, the weight of the file.

I prefer this option instead of obtaining the size dinamically into jsp pages.

I need it for information pages, example:
PDF (image) name_file [1.230 kb]

Anybody knows how can I do this?

Thank you for your help!!

Regards
3 REPLIES 3

v912485
Champ in-the-making
Champ in-the-making
Hi dvc,

I have a similar problem. Did you manage to solve it?

Thanks,
Allan

mrogers
Star Contributor
Star Contributor
The file size is one of the attributes of the ContentData structure returned from the ContentService.

v912485
Champ in-the-making
Champ in-the-making
Thanks for the quick reply, but how would I access the ContentService from a (WCM) freemarker template?
To give you a bit more context, this template generates a jsp from a webform which contains links. The text for the links should contain file size of the files they point to, just as described in the first post.