jejacks0n / mercury

Mercury Editor: The Rails WYSIWYG editor that allows embedding full page editing capabilities directly inline.
http://jejacks0n.github.com/mercury
Other
2.63k stars 531 forks source link

Image upload problem in a non-rails environment (2) #135

Closed Hans123 closed 12 years ago

Hans123 commented 12 years ago

i don't have the permission to reopen a issue, so i have to write a new one with the the same problem at issue #130.

ok, now i have written a script. that script saves the image upload from the mercury-editor and gives back a JSON response via CGI.

saving of the image is ok but at the end of the uploading process there ist still an error

"Unable to process response: TypeError: Cannot read property "url" of type undefined"

My Response Header:

Connection:Keep-Alive Content-Type:application/json Date:Tue, 17 Jan 2012 13:58:36 GMT Keep-Alive:timeout=15, max=100 Server:Apache/2.2.8 (Linux/SUSE) Transfer-Encoding:chunked

Response JSON-String is like this:

{"url":"http://mydomain.de/images/signor-rossi-7.jpg?size=15634"}

what am I doing wrong?

Hans123 commented 12 years ago

Ok, solved the problem.

the responded JSON string must be in the form of

{"image":{"url":"http://mydomain.de/images/signor-rossi-7.jpg?size=15634"}}

this is also described in issue #96

jejacks0n commented 12 years ago

I thought I made it so your first example works, but ok. Glad you solved it. =)