Quantcast
Channel: Optimizely Search & Navigation
Viewing all articles
Browse latest Browse all 6894

How to retrieve the file size of a file in VPP

$
0
0

Hi,

I've uploaded a document to the VPP, and I've since linked to it in a page. Im trying to display the file extension and file size next to the link. I've been searching thorugh the forums and the closest I've come is the following:-

filepath = "\globalassets\documents\gt8amniocentesis0111.pdf"

var file = HostingEnvironment.VirtualPathProvider.GetFile(filepath) as UnifiedFile;

return file.Length / 1024 + "Kb"

Except each time I try to use this I get the error:-


Viewing all articles
Browse latest Browse all 6894

Trending Articles