Skip to content

Commit b749bf0

Browse files
committed
minor #9142 [BrowserKit] Add snippet: how to upload a file (lyrixx)
This PR was merged into the 2.7 branch. Discussion ---------- [BrowserKit] Add snippet: how to upload a file Commits ------- 66b6fd0 [BrowserKit] Add snippet: how to upload a file
2 parents eb637f0 + 66b6fd0 commit b749bf0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

components/browser_kit.rst

+3
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)