Skip to content

Commit 89b4cad

Browse files
committed
Merge branch '2.8' into 3.4
* 2.8: [BrowserKit] Add snippet: how to upload a file
2 parents 18c7382 + b01d242 commit 89b4cad

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

components/browser_kit.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ method (which makes the needed HTTP POST request to submit the form contents)::
109109
$form['login'] = 'symfonyfan';
110110
$form['password'] = 'anypass';
111111

112+
// To upload a file, the value should be the absolute file path
113+
$form['file'] = __FILE__;
114+
112115
// submit that form
113116
$crawler = $client->submit($form);
114117

0 commit comments

Comments
 (0)