there is a property in one document of type upload, I am able to show the file path in xslt but I don't know how to show the size of this uploaded file. I tried to use the C# script in the xslt using FileInfo class . But I don't get the access to this class becouse in xslt we can use only static method. Static method does not allow to use this class and server.mappath. Please help to solve this issue. I am not sure what i should do know.
Adding a property called 'umbracoBytes' as a label to the same Document Type as the upload property. The file upload property should should pre-populte this label with the file size.
Creating a static c# wrapper method that internally uses the FileInfo class.
Get File Size of a uploaded item
there is a property in one document of type upload, I am able to show the file path in xslt but I don't know how to show the size of this uploaded file. I tried to use the C# script in the xslt using FileInfo class . But I don't get the access to this class becouse in xslt we can use only static method. Static method does not allow to use this class and server.mappath. Please help to solve this issue. I am not sure what i should do know.
Thanks in advance
Hi Rajeev,
There are a couple of ways you can solve this:
Adding a property called 'umbracoBytes' as a label to the same Document Type as the upload property. The file upload property should should pre-populte this label with the file size.
Creating a static c# wrapper method that internally uses the FileInfo class.
HTH,
Hendy
Manulaly adding filesize to label each time is not the best way, I think...
Hi Rajeev,
Using the 'umbracoBytes' label is an automatic process.
Cheers,
Hendy
is working on a reply...