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

How to intercept file to download #296

Open
foxtrails opened this issue Feb 23, 2017 · 1 comment
Open

How to intercept file to download #296

foxtrails opened this issue Feb 23, 2017 · 1 comment

Comments

@foxtrails
Copy link

Hi Team,

Firstly, thanks in advance for your help here, it's really appreciated!

I've successfully managed to get Goutte to authenticate, hit a URL, change a select field and click a submit button.

The page then reloads and as it finishes loading, it downloads a file to the client.

How do I intercept this file within Goutte? I've read as much doco as I can but can't seem to find an answer. I then want to basically hit this file, traverse it and save it locally.

Depending upon the file type, I want to traverse it, or save it locally.

Thanks :-)

@TakesTheBiscuit
Copy link

Hi @foxtrails - did you ever resolve your issue? my thought would be that you'll want to implement this insomething like Insomnia Rest client or POSTMAN app, check the http headers which come back on the response, are they holding a 301 redirect, or, is there some client javascript firing to get the file? My gut reaction is that in your case the server is sending a 301 redirect which is instructing the browser to hit the file directly and as a result downloads it

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

2 participants