Problems with EPiServer File Events(UnifiedFileAdded)

Hi. I am trying out the EPiServer File Events for a project I am working on. When a picture file is added, I want to use a third party component to genereate some extra files out of the originalfile that is added. I then need to know the lenght of the file, but the length of the originalfile is 0. Why is this? I use the code below to get the UnifiedFile. Is this a wrong way to do it? Is there another way I can get the file and its size? protected void UnifiedDirectory_UnifiedFileAdded(UnifiedDirectory sender, UnifiedVirtualPathEventArgs e) { UnifiedFile addedFile = HostingEnvironment.VirtualPathProvider.GetFile(e.NewVirtualPath) as UnifiedFile; }
Jan 09, 2008 9:27
That event fires when the file is added to the directory which happens before any data is written to the file. Maybe you could try the CheckedIn event instead..
Jan 09, 2008 11:01
Hi Per. I just tried the UnifiedFile.UnifiedFileCheckedIn event, and it looks like that will solve my problem. Thank you very much :) BR, Tore
Jan 09, 2008 11:16
Hei Per. Can I still use the event CheckedIn if the filesystem is a Native File System? Or will this only work if the filesystem is a Versionig File System? BR, Tore
Jan 09, 2008 13:07
Only works with versioning..
Jan 09, 2008 18:13
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.