Skip to content
This repository has been archived by the owner on Apr 1, 2023. It is now read-only.

How to handle file download on form submission? #120

Closed
dgmdan opened this issue Oct 3, 2013 · 3 comments
Closed

How to handle file download on form submission? #120

dgmdan opened this issue Oct 3, 2013 · 3 comments

Comments

@dgmdan
Copy link

dgmdan commented Oct 3, 2013

I'm using Goutte to submit a form where the response isn't an HTML page but rather a MS Excel file. Specifically the response has these headers:

Content-Type: application/vnd.ms-excel
Content-Disposition: attachment; filename="stuff.xls"

How can I access the contents of this file?

@dgmdan
Copy link
Author

dgmdan commented Oct 8, 2013

I figured this out. The file contents are in $client->getResponse()->getContent().

@dgmdan dgmdan closed this as completed Oct 8, 2013
@kojca-mmye
Copy link

Sorrry, Now. How to handle it
Symfony\Component\Debug\Exception\FatalThrowableError : Call to undefined method Symfony\Component\DomCrawler\Crawler::getResponse()

@raharima
Copy link

raharima commented Sep 29, 2020

@kojca-mmye use crawler like this :

$crawler = $client->submit($myForm)
$client->getResponse()->getContent());

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

No branches or pull requests

3 participants