Which version of EPiServer? Ive done a fileupload block in EPiServer 7.
It's EPi 7 Per. I'll have a look at your fileupload block.
P.S Have you blogged about it? Couldn't see it on EPiServer World and Google gave a blank.
I haven't blogged about it. Send me an email at: per dot nergard at knowit dot se so can I mail you the code.
It seems my problem is that the page I am trying to save the page files for is not published. If the page is published then it works as nomal.
We ran into that as well. Solved by setting bypassAccessCheck in episerverframework to true. But I guess on some sites you don't want to do that.
Update from EPiServer: If the page isn't published then the user for the request has to at least Edit rights for the page. In my case the user is anonymous so doesn't have the rights.
I am trying to use the code example from Fredrik Haglund to allow an anonymous user to upload a file and store it in PageFiles but I get an UnauthorizedAccessException. It seem the creating of the PageFiles folder works but it's the EPiServer.Initialization.EventHandler.UnifiedDirectory_UnifiedDirectoryAdded method that is causing the problem by calling GetDirectory which in turn does an access check for AccessLevel.Read on the newly created directory. Any ideas to get around this?
Call stack below: