Installation help is needed

Sep 12, 2013 at 8:06 PM
Edited Sep 12, 2013 at 9:11 PM
Hi there,
Many thanks for sharing this one with us!
For some reason im not able to pass the installation stage.
When accessing the http://localhost:53433/elfinder.connector i get { "error": "Command not set" } msg.

here is my webconfig:
<?xml version="1.0" encoding="utf-8"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <configSections>
    <section name="elFinder" type="elFinder.Connector.Config.AppConnectorConfig, elFinder.Connector" requirePermission="false" />
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections>
  <connectionStrings>
    <add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-ELFinderConnector-20130912212451;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-ELFinderConnector-20130912212451.mdf" providerName="System.Data.SqlClient" />
  </connectionStrings>
  <appSettings>
    <add key="webpages:Version" value="2.0.0.0" />
    <add key="webpages:Enabled" value="false" />
    <add key="PreserveLoginUrl" value="true" />
    <add key="ClientValidationEnabled" value="true" />
    <add key="UnobtrusiveJavaScriptEnabled" value="true" />
  </appSettings>
  <system.web>
    <compilation debug="true" targetFramework="4.5" />
    <httpRuntime targetFramework="4.5" />
    <authentication mode="Forms">
      <forms loginUrl="~/Account/Login" timeout="2880" />
    </authentication>
    <pages>
      <namespaces>
        <add namespace="System.Web.Helpers" />
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Optimization" />
        <add namespace="System.Web.Routing" />
        <add namespace="System.Web.WebPages" />
      </namespaces>
    </pages>
  </system.web>
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
  <handlers>
    <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
    <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
    <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
    <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
    <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
    <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
    <add name="elfinder" path="elfinder.connector" type="elFinder.Connector.Connector, elFinder.Connector" verb="*" />
  </handlers>
  </system.webServer>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="DotNetOpenAuth.Core" publicKeyToken="2780ccd10d57b246" />
        <bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.1.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="DotNetOpenAuth.AspNet" publicKeyToken="2780ccd10d57b246" />
        <bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.1.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-1.3.0.0" newVersion="1.3.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
      <parameters>
        <parameter value="v11.0" />
      </parameters>
    </defaultConnectionFactory>
  </entityFramework>
  <elFinder apiVersion="2.0"
    localFSRootDirectoryPath="D:\Dev\Projects\ELFinderConnector\ELFinderConnector\data"
    localFSThumbsDirectoryPath="D:\Dev\Projects\ELFinderConnector\ELFinderConnector\data"
    rootDirectoryName="Root"
    uploadMaxSize="20M"
    defaultVolumeName="LocalFileSystem"
    baseUrl="http://localhost:53433/data/"
    baseThumbsUrl="http://localhost:53433/data/"
    duplicateFilePattern="Copy of {0}"
    duplicateDirectoryPattern="Copy of {0}"
    thumbsSize="48,48">
  </elFinder>
</configuration>
and my global.asax:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
using Autofac;
using elFinder.Connector;

namespace ELFinderConnector
{
    // Note: For instructions on enabling IIS6 or IIS7 classic mode, 
    // visit http://go.microsoft.com/?LinkId=9394801

    public class MvcApplication : System.Web.HttpApplication
    {
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            RegisterRoutes(RouteTable.Routes);

            // register IoC
            var builder = new ContainerBuilder();
            // add other registrations...
            // add elFinder connector registration
            builder.RegisterElFinderConnector();
            // create container
            var _container = builder.Build();
            // need also to set container in elFinder module
            _container.SetAsElFinderResolver();




            WebApiConfig.Register(GlobalConfiguration.Configuration);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            AuthConfig.RegisterAuth();
        }
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("elfinder.connector");

        }
    }
}
Will appreciate any input.
Regards,
mkariti
Sep 12, 2013 at 9:14 PM
Ok Just and extra char there.
All sorted!
this is is great.
Coordinator
Sep 12, 2013 at 10:13 PM
Great, glad you sorted it out.
Maybe you could post some information about the solution for others?
Sep 13, 2013 at 7:24 AM
Edited Sep 13, 2013 at 7:31 AM
Of course.
documentation section --> Web.config section --> point 2
<elFinder apiVersion="2.0"
    localFSRootDirectoryPath="c:\users"
    localFSThumbsDirectoryPath="c:\users\.thumbs"
    rootDirectoryName="Root"
    uploadMaxSize="20M"
    defaultVolumeName="LocalFileSystem"
    baseUrl="http://localhost:55470/data/"
    baseThumbsUrl="http://localhost:55470/data/.thumbs/"> *** Remove the '>' char ***
    duplicateFilePattern="Copy of {0}"
    duplicateDirectoryPattern="Copy of {0}"
    thumbsSize="48,48">
</elFinder>
End of baseThumbsUrl line Remove the '>' char


The cost of the simplicity of copy and paste.

Again, many thanks for this great project!

I downloaded the source but wanted to ask how easy will it be to determine the root folder in the code rather than in the web config? (i.g. when accessing the page)
Cheers
mkariti
Sep 13, 2013 at 11:14 AM
Edited Sep 13, 2013 at 11:14 AM
Hi,
Im trying to integrate the elfinder into Umbraco CMS and Im getting the following Error:
   at elFinder.Connector.Connector.ProcessRequest(HttpContext context) in d:\Dev\Projects\ElfinderAspNet OpenSource\elFinder.Connector\Connector.cs:line 39
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Any Idea?
Cheers
mkariti
Sep 13, 2013 at 12:49 PM
Edited Sep 13, 2013 at 7:59 PM
Ok So managed to solve this one as well.
just dont use the global.asax and instead use umbraco's


Ive also managed to set each user with its own folder by using the .Net Membership provider
and by overriding the LocalFSRootDirectoryPath prop.
Feb 24 at 11:41 PM
Mkariti,

Can you give me some more detail about how you went about overriding the LocalFSRootDirectoryPath prop, because I need to do a similar thing.

I have two different folders with different elfinders and I want to set each elfinder to look at a different folder.
Feb 25 at 8:36 PM
Hi Bananadon,
I’m my case my users are registered users so I can easily work with Microsoft member provider to find out the current logged in member and in turn set right folder for each user.
I guess you can do the same if you can set a flag that will let you know which elfinder is making the request.
To do so just return the appropriate folder path In the LocalFSRootDirectoryPath property in the AppConnectorConfig.cs file.
Regards,
mkariti