Question

I have a problem importing laravel elFinder.

When i use the normal links:

<link rel="stylesheet" type="text/css" media="screen" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/themes/smoothness/jquery-ui.css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" ></script> 
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/jquery-ui.min.js"></script>

<link rel="stylesheet" type="text/css" media="screen" href="/laravel4_test2/public/filemanager1/css/elfinder.min.css">


<script type="text/javascript" src="/laravel4_test2/public/filemanager1/js/elfinder.min.js"></script>

<!-- Mac OS X Finder style for jQuery UI smoothness theme (OPTIONAL) -->
<link rel="stylesheet" type="text/css" media="screen" href="/laravel4_test2/public/filemanager1/css/theme.css">
 <script type="text/javascript" src="/laravel4_test2/public/filemanager1/js/i18n/elfinder.nl.js"></script>

Everything works on my localhost.

But when i move my app to a online sever. Everything stops working :(

As a first attempt to fix my error i tried converting my import to laravel code. But now my filmanager also does not work locally anymore :( This is my code:

      <!-- elfinder imports -->
{{HTML::style('http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/themes/smoothness/jquery-ui.css', array('type' => 'text/css'))}}
 {{HTML::script('http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js', array('type' => 'text/javascript'))}}
 {{HTML::script('http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/jquery-ui.min.js', array('type' => 'text/javascript'))}}
{{HTML::style('laravel4_test2/public/filemanager1/css/elfinder.min.css',  array('type' => 'text/css'))}}
 {{HTML::script('laravel4_test2/public/js/elfinder.min.js', array('type' => 'text/javascript'))}}
<!-- Mac OS X Finder style for jQuery UI smoothness theme (OPTIONAL) -->
{{HTML::style('laravel4_test2/public/filemanager1/css/theme.css',  array('type' => 'text/css'))}}
  {{HTML::script('laravel4_test2/public/filemanager1/js/i18n/elfinder.nl.js', array('media' => 'screen'))}}

Can anyone see a serror in my code?

Was it helpful?

Solution

It all depends on where you application is in your server.

You are pointing to your files in

laravel4_test2/public/

Is this the way you access your application in your server? Do you point your browser to

http://domain.com/laravel4_test2/public/

To get to your home page? If you point your browser just to

http://domain.com/

Then you have to drop it all in your links too:

{{HTML::style('filemanager1/css/theme.css', array('type' => 'text/css'))}}

Having a correct Laravel installation, with your VirtualHost and .htaccess correctly configured to drop the /public/index.php from your links, this is the way you should be using elfinder:

<html>
    {{HTML::style('http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/themes/smoothness/jquery-ui.css', array('media' => 'screen'))}}
    {{HTML::script('http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js', array('type' => 'text/javascript'))}}
    {{HTML::script('http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/jquery-ui.min.js', array('type' => 'text/javascript'))}}
    {{HTML::style('filemanager1/css/elfinder.min.css', array('media' => 'screen'))}}
    {{HTML::script('filemanager1/js/elfinder.min.js', array('type' => 'text/javascript'))}}
    {{HTML::style('filemanager1/css/theme.css', array('media' => 'screen'))}}

    <body>

    Elfinder
    <!-- Element where elFinder will be created (REQUIRED) -->
    <div id="elfinder"></div>

    <script type="text/javascript" charset="utf-8">
        $().ready(function() {
            var elf = $('#elfinder').elfinder({
                // lang: 'ru',             // language (OPTIONAL)
                url : 'filemanager1/php/connector.php'  // connector URL (REQUIRED)
            }).elfinder('instance');            
        });
    </script>

    </body>
</html>

OTHER TIPS

Strange thing is. Now i have

<link rel="stylesheet" type="text/css" media="screen" href="http://subdomain.domain.nl/public/filemanager1/css/theme.css">

Elfinder works locally. But still online it does not work. So the online imports work.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top