comur / ComurImageBundle

Image upload / crop bundle for Symfony2
105 stars 76 forks source link

Unexpected token U in JSON at position 66 #108

Closed ahmed-bhs closed 7 years ago

ahmed-bhs commented 7 years ago

I'm using comur/image-bundle 1.3.x-dev f5d2237 Symfony 3.2.12 I'm facing a problém when i click on edit nothing works right, This is my console js log:

 Uncaught SyntaxError: Unexpected token U in JSON at position 66
    at JSON.parse (<anonymous>)
    at Function.parseJSON (jquery.js:4)
    at HTMLDivElement.<anonymous> (new:203)
    at HTMLDivElement.dispatch (jquery.js:5)
    at HTMLDivElement.v.handle (jquery.js:5)
ahmed-bhs commented 7 years ago

Solved: public function getUploadRootDir() { // absolute path to your directory where images must be saved $dir = strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' ? str_replace('\', '/', DIR) : DIR; return $dir.'/../../../../web/'.$this->getUploadDir(); }