November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
No I use the multiplexing providers with starsuite and sql providers. Could you please explain the aspnet_regusr scenario a bit more, I am not familiar with it?
Edit: It seems to be a server configuration issue, I get the same error message if I try to open a file version from the admin mode file manager. On a different system I don't get these errors, but I can not download file versions (the web browser says that the file does not exist).
Well you see the ASP.Net client is a Windows user - complete with their own account. I would first try checking the folder security and make sure that the account for ASP.Net can access the folder.
Check the link http://www.mvps.org/marksxp/WindowsXP/aspdot.php for more information about that.
I assume you have never had access to these files ever so this is probably the answer. The process REGUSR is similar to in Visual Studio, going to "Project" tab and selecting "ASP.Net Configuration" this is where you can configure your solutions user and role management. You should be familiar with this part of ASP.Net?
Good luck!
Thank you for yor reply.
Yes, I have checked the ASP.NET user's file permissions. They seem fine (the same as for any other files in the VPP, which I can access, though these files don't come in multiple versions).
It is also possible to get all files without problem, but only the current version of the file. My problem only occurs when I bring up the version list and try to view a specific version. I can roll back to any version (which actually creates a new current version) and open it as the current version, but I can not read any of the previous versions.
I have never heard of aspnet_regusr, I suppose you don't mean aspnet_regiis since you compare it to the ASP.Net configuration. The users/roles there however are the same as can be administered from EPiServer, right?
They have the correct permissions in file management, if they don't they won't see the files or delete/check out etc will be disabled according to permissions. The users have full access and can create new versions, remove files etc. But not view previous versions of the files, which generates the error (404 or autorization, seems to depend on if I have friendly errors or not). The URL the browser tries to get when getting a version is the same as for the current version, but with a slash and a GUID appended. I suppose the VPP interprets this wrong in some way and actually looks for a file named as the GUID?
No problems - glad to help! Yes I did mean REGIIS - but the main thing I would like to know is, have you tried backing up the files and doing a fresh install to see if it's just a configuration bug - something that got changed like a property or something?
No I haven't, I will if I can find the time. But I discovered something else strange. When I logged in as the user who created the file versions I can download them. Even though the file permissions of that user are equal to those of the admin user. So only the creator can download previous file versions?
A complication issue is perhaps that there are two user databases in multiplexing (sql and starsuite providers). But even if I log in as a user from the same database as the user who can download the file, I get the same error as with a user from the other database. So that still points to the creator.
An other complication is that this is a migrated site and the file versions I'm trying to access were created before the migration.
I've been having a similar issue trying to access previous file versions.
I've lodged a number of support calls and even the code i'm given back by EPiServer does not seem to work correctly.
<%
foreach (EPiServer.Web.Hosting.UnifiedVersion file in ((EPiServer.Web.Hosting.VersioningFile)System.Web.Hosting.HostingEnvironment.VirtualPathProvider.GetFile("/Global/myfile.gif")).GetVersions())
{
%>
<a href="<%=file.VirtualPath + "/download" + file.Extension %>">
<%=file.Name%>
</a>
<%
} %>
This still ends up saying the file does not exist. I can't find any implementations are code examples of this working and my client is currently giving me a lot of hassle for something that they see as basic functionality of the platform.
Has anyone got any sample code of this working?
Thanks,
Simon
I have coded the following solution which should assist. The code takes the versions which exist for a file in the Documents folder and displays them simply on a web page, as links which can be opened (inserted into a DIV element ID=generatedVersionsBox) - all of which can also be used with "Save Target As" function.
Hope this helps - EPiServer Support Team...
using EPiServer.Web.Hosting;
using System.Collections.Generic;
protected void PathTest_Click(object sender, EventArgs e)
{
generatedVersionsBox.InnerHtml = "";
string documentPath = "~/Documents/";
bool documentDirExists = System.Web.Hosting.HostingEnvironment.VirtualPathProvider.DirectoryExists(documentPath);
if (documentDirExists)
{
foreach (VersioningFile file in System.Web.Hosting.HostingEnvironment.VirtualPathProvider.GetDirectory(documentPath).Files)
{
IList<UnifiedVersion> versions = file.GetVersions();
foreach (UnifiedVersion version in versions)
{
string filePath = version.VirtualPath;
if (filePath.EndsWith("/") == false)
{
filePath = filePath + "/";
}
string versionNumber = version.Name;
string virtualPathWithoutGuid = version.VirtualPath.Substring(0, filePath.Substring(0, filePath.Length - 1).LastIndexOf('/'));
string nameOfVersionedFileFromVirtualPath = virtualPathWithoutGuid.Substring(virtualPathWithoutGuid.LastIndexOf('/') + 1);
string nameToSave = nameOfVersionedFileFromVirtualPath.Substring(0, nameOfVersionedFileFromVirtualPath.IndexOf('.')) + "_V" + versionNumber;
generatedVersionsBox.InnerHtml = generatedVersionsBox.InnerHtml + "<a href='" + filePath + nameToSave + "'>" + nameToSave + "</a><br />";
}
}
}
}