diff options
Diffstat (limited to 'user_guide/libraries/file_uploading.html')
-rw-r--r-- | user_guide/libraries/file_uploading.html | 57 |
1 files changed, 29 insertions, 28 deletions
diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html index 21fd2a6ba..d9a993a74 100644 --- a/user_guide/libraries/file_uploading.html +++ b/user_guide/libraries/file_uploading.html @@ -89,26 +89,27 @@ preferences, restricting the type and size of the files.</p> folder:</p>
-<textarea class="textarea" style="width:100%" cols="50" rows="23"><html>
-<head>
-<title>Upload Form</title>
-</head>
-<body>
+<textarea class="textarea" style="width:100%" cols="50" rows="23">
+<html>
+<head>
+<title>Upload Form</title>
+</head>
+<body>
-<?=$error;?>
+<?=$error;?>
-<?=form_open_multipart('upload/do_upload'); ?>
+<?=form_open_multipart('upload/do_upload'); ?>
-<input type="file" name="userfile" size="20" />
+<input type="file" name="userfile" size="20" />
-<br /><br />
+<br /><br />
-<input type="submit" value="upload" />
+<input type="submit" value="upload" />
-</form>
+</form>
-</body>
-</html></textarea>
+</body>
+</html></textarea>
<p>You'll notice we are using a form helper to create the opening form tag. File uploads require a multipart form, so the helper
creates the proper syntax for you. You'll also notice we have an $error variable. This is so we can show error messages in the event
@@ -120,24 +121,24 @@ the user does something wrong.</p> <p>Using a text editor, create a form called <dfn>upload_success.php</dfn>.
In it, place this code and save it to your <samp>applications/views/</samp> folder:</p>
-<textarea class="textarea" style="width:100%" cols="50" rows="20"><html>
-<head>
-<title>Upload Form</title>
-</head>
-<body>
+<textarea class="textarea" style="width:100%" cols="50" rows="20"><html>
+<head>
+<title>Upload Form</title>
+</head>
+<body>
-<h3>Your file was successfully uploaded!</h3>
+<h3>Your file was successfully uploaded!</h3>
-<ul>
-<?php foreach($upload_data as $item => $value):?>
-<li><?=$item;?>: <?=$value;?></li>
-<?php endforeach; ?>
-</ul>
+<ul>
+<?php foreach($upload_data as $item => $value):?>
+<li><?=$item;?>: <?=$value;?></li>
+<?php endforeach; ?>
+</ul>
-<p><?=anchor('upload', 'Upload Another File!'); ?></p>
+<p><?=anchor('upload', 'Upload Another File!'); ?></p>
-</body>
-</html></textarea>
+</body>
+</html></textarea>
<h2>The Controller</h2>
@@ -428,7 +429,7 @@ Previous Topic: <a href="download_helper.html">Download Helper</a> <a href="#top">Top of Page</a> ·
<a href="../index.html">User Guide Home</a> ·
Next Topic: <a href="ftp.html">FTP Class</a>
-<p>
+</p>
<p><a href="http://www.codeigniter.com">CodeIgniter</a> · Copyright © 2007 · <a href="http://ellislab.com/">Ellislab, Inc.</a></p>
</div>
|