Try simplest:

  public function executeWriteUserData(sfWebRequest $request)
  {
      $this->renderText($youResultArray);
      return sfView::NONE;
  }

I dont use response with construction "application/json"
This method is work.

On May 24, 4:15 pm, santail <nikolai.muh...@gmail.com> wrote:
> I have a page which uploads some file. I need to return JSON response
> to the page after file is uploaded. I have the next code in action:
>
> $this->getResponse()->setHttpHeader('Content-Type','application/json;
> charset=utf-8');
> $result = array(
>     "success" => true,
>     "picture" => array(
>         "id" => $picture->getId()
>      ));
>
> return $this->renderText(json_encode($result));
>
> But after uploading browser shows me "Save File" dialog with JSON
> reponse body as file.
>
> Why is it happening ? How should I send JSON back without any "Save
> file" promt dialogs ?
>
> Thank you!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to