File tree Expand file tree Collapse file tree
user_guide_src/source/libraries Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -81,6 +81,13 @@ this code and save it to your **app/Controllers/** directory:
8181 only :ref: `rules-for-file-uploads ` can be used to validate upload file with :doc: `validation `.
8282 The rule ``required `` also can't be used, so use ``uploaded `` instead.
8383
84+ The Routes
85+ ==========
86+
87+ Using a text editor, open **app/Config/Routes.php **. In it, add the following two routes:
88+
89+ .. literalinclude :: uploaded_files/021.php
90+
8491The Upload Directory
8592====================
8693
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ // ...
4+
5+ /*
6+ * --------------------------------------------------------------------
7+ * Route Definitions
8+ * --------------------------------------------------------------------
9+ */
10+
11+ // We get a performance increase by specifying the default
12+ // route since we don't have to scan directories.
13+ $ routes ->get ('/ ' , 'Home::index ' );
14+
15+ $ routes ->get ('upload ' , 'Upload::index ' ); // Add this line.
16+ $ routes ->post ('upload/upload ' , 'Upload::upload ' ); // Add this line.
17+
18+ // ...
You can’t perform that action at this time.
0 commit comments