November Happy Hour will be moved to Thursday December 5th.

Problems with EPiServer File Events(UnifiedFileAdded)

Vote:
 
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; }
#15955
Jan 09, 2008 9:27
Vote:
 
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..
#16688
Jan 09, 2008 11:01
Vote:
 
Hi Per. I just tried the UnifiedFile.UnifiedFileCheckedIn event, and it looks like that will solve my problem. Thank you very much :) BR, Tore
#16689
Jan 09, 2008 11:16
Vote:
 
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
#16690
Jan 09, 2008 13:07
Vote:
 
Only works with versioning..
#16691
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.