Get file size

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-18-2009 04:48 AM
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
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
Labels:
- Labels:
-
Archive
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2010 06:28 AM
Hi dvc,
I have a similar problem. Did you manage to solve it?
Thanks,
Allan
I have a similar problem. Did you manage to solve it?
Thanks,
Allan
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2010 07:56 AM
The file size is one of the attributes of the ContentData structure returned from the ContentService.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2010 08:18 AM
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.
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.
