Exemple #1
0
<p>This example is supposed to upload a file and store the name inside a database<br>
(you need to create a database to use this example). </p>
<p>Max. filesize = <?php 
echo $max_size;
?>
 bytes.</p>
<form name="form1" enctype="multipart/form-data" method="post" action="<?php 
echo $_SERVER['PHP_SELF'];
?>
">
  <input type="hidden" name="MAX_FILE_SIZE" value="<?php 
echo $max_size;
?>
">
  <?php 
echo $my_upload->create_file_field("upload", "Select a file...", 25, false);
?>
  <input type="submit" name="Submit" value="Submit">
</form>
<br clear="all">
<p><?php 
echo $my_upload->show_error_string();
?>
</p>

<h3>The next file is an example how to show a file while using the method "create_file_field"</h3>
<p>Note the title from the file field if the file does not exist. There is no other function inside this exaple the showing the field.</p>
<form>
<?php 
echo $my_upload->create_file_field("file_in_db", "The file inside the upload class .zip file", 25, true, "Replace old file?", $_SERVER['DOCUMENT_ROOT'] . "/classes/upload/", "example_for_db.jpg", true, 30, "Delete image");
?>