Skip to content

When upload image file, elfinder say「unable to connect to backend.」 #229

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
helloooideeeeea opened this issue Mar 14, 2016 · 7 comments

Comments

@helloooideeeeea
Copy link

Monolog wrote the following.

request.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\ContextErrorException: "Notice: Undefined variable: header" at /xxx/xxx/hogeApp/vendor/helios-ag/fm-elfinder-php-connector/src/ElFinder.php line 1543 {"exception":"[object](Symfony\Component\Debug\Exception\ContextErrorException%28code: 0%29: Notice: Undefined variable: header at /xxx/xxx/hogeApp/vendor/helios-ag/fm-elfinder-php-connector/src/ElFinder.php:1543)"} []

Until a little before, able to upload image.
please tell me what is the problem, and how resolve.

thanks!

Bundle Version:

version, 6.1

Symfony2 Version:

version, 2.8.3

ElFinder#upload($args)
I try to dump($args). the following is result.

array:10 [▼
"target" => "l1_dGh1bWJuYWlsL05ld0ZvbGRlcg"
"FILES" => []
"mimes" => ""
"html" => ""
"upload" => ""
"name" => array:1 [▼
0 => "hoge.jpg"
]
"upload_path" => ""
"chunk" => ""
"cid" => ""
"debug" => ""
]

my app/config settings.

fm_elfinder:
    instances:


        default:
            locale: en 
            editor: ckeditor
            include_assets: true 
            connector:
                roots:
                    uploads:
                        driver: LocalFileSystem
                        path: uploads
                        upload_allow: ['image/png', 'image/jpg', 'image/jpeg']
                        upload_deny: ['all']
                        upload_max_size: 2M


        my_form:
            locale: en
            editor: form 
            include_assets: true
            connector:
                roots:
                    uploads:
                        driver: LocalFileSystem
                        path: uploads
                        upload_allow: ['image/png', 'image/jpg', 'image/jpeg']
                        upload_deny: ['all']
                        upload_max_size: 2M

upload cmd url
http://localhost:8888/app_dev.php/efconnect/my_form?cmd=upload&target=l1_YXJ0aWNsZQ&name%5B%5D=hoge.jpg&FILES=&_=1457946144238

@helloooideeeeea
Copy link
Author

Is it case that ElFinder#upload($args)'s $args['upload'] is ""?

@helloooideeeeea
Copy link
Author

resolved it!
ElFinder 's source was old.
execute the following command, I resolved it.
$ composer update --with-dependencies helios-ag/fm-elfinder-bundle

@salamichel
Copy link

Hi, i exactly the same issue (CRITICAL - Uncaught PHP Exception Symfony\Component\Debug\Exception\ContextErrorException: "Notice: Undefined variable: header" at H:\wamp2\www\appar\vendor\helios-ag\fm-elfinder-php-connector\src\ElFinder.php line 1543 )

I tried to update package with the command line "composer update --with-dependencies helios-ag/fm-elfinder-bundle" but composer said "Nothing to install or update".

I'm on symfone 2.8 and php 5.5

I can't upload file on server ,other functionnalities works (browser, use picture and so on) but unable to upload, i'm stuck !

Please help

@helios-ag
Copy link
Owner

Hi @salamichel
What about platform setting in your composer.json? Also you can explicitly set connector library to fetch with

composer require helios-ag/fm-elfinder-php-connector: dev-master 

or

composer require helios-ag/fm-elfinder-php-connector: 2.5.1

@salamichel
Copy link

Hi , thank for your reply, i tried both command

Could not find package 2.5.1 at any version for your minimum-stability (stable). Check the package spelling or your minimum-stability

here my composer

{
"name": "symfony/symfony-demo",
"license": "MIT",
"type": "project",
"description": "Symfony Demo Application",
"autoload": {
"psr-4": {
"": "src/"
},
"classmap": ["app/AppKernel.php", "app/AppCache.php"]
},
"require": {
"php": ">=5.3.9",
"ext-pdo_sqlite": "",
"coresphere/console-bundle": "0.2.0",
"doctrine/doctrine-bundle": "~1.5",
"doctrine/doctrine-fixtures-bundle": "~2.2",
"doctrine/orm": "~2.4",
"erusev/parsedown": "~1.5",
"ezyang/htmlpurifier": "~4.7",
"incenteev/composer-parameter-handler": "~2.1",
"ircmaxell/password-compat": "~1.0",
"knplabs/knp-paginator-bundle": "~2.4",
"leafo/scssphp": "^0.4.0",
"patchwork/jsqueeze": "~1.0",
"sensio/distribution-bundle": "~5.0",
"sensio/framework-extra-bundle": "~3.0",
"symfony/assetic-bundle": "~2.6",
"symfony/monolog-bundle": "~2.7",
"symfony/swiftmailer-bundle": "~2.3",
"symfony/symfony": "~2.8",
"twig/extensions": "~1.2",
"sonata-project/admin-bundle": "2.3.
",
"sonata-project/doctrine-orm-admin-bundle": "2.3.*",
"stof/doctrine-extensions-bundle": "^1.2",
"trsteel/ckeditor-bundle": "^1.10",
"helios-ag/fm-elfinder-bundle": "~6",
"egeloen/ckeditor-bundle": "^4.0",
"sonata-project/media-bundle": "^2.3"
},
"require-dev": {
"sensio/generator-bundle": "~3.0"
},
"scripts": {
"post-install-cmd": [
"Incenteev\ParameterHandler\ScriptHandler::buildParameters",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFile",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::prepareDeploymentTarget"
],
"post-update-cmd": [
"Incenteev\ParameterHandler\ScriptHandler::buildParameters",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFile",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::prepareDeploymentTarget"
]
},
"config": {
"bin-dir": "bin",
"platform": {
"php": "5.3.9"
},
"component-dir": "web/assets"
},
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"symfony-assets-install": "relative",
"incenteev-parameters": {
"file": "app/config/parameters.yml",
"env-map": {
"database_url": "DATABASE_URL",
"secret": "SYMFONY_SECRET"
}
}
}
}

@helios-ag
Copy link
Owner

This

"platform": {
"php": "5.3.9"

prevents installing 2.5.1, please leverage php version to at least 5.4

@salamichel
Copy link

You're the one! Thank you for assistance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants