How to Create Upload File
In this article, we are going to learn how to create Upload File. This simple Upload File the users enable to upload any kind of files and save into the database table.
Creating one file upload for the files that we are going to upload, one TextBox for the file name, and one TextArea for the file description as shown in the image below.
Here's the simple source code to create as shown in the image above.
- <div class="row-fluid">
- <div class="span4">
- <!----- form ---->
- <form action="upload.php" method="post" enctype="multipart/form-data" name="upload">
- <input name="uploaded_file" type="file" class="input-xlarge" required/>
- <input type="hidden" name="MAX_FILE_SIZE" value="1000000" />
- <input type="text" name="fname" required>
- <input name="Upload" type="submit" value="Upload" class="btn btn-primary btn-large" />
- <!---- end form -->
- <div class="span8">
- <table class="table table-bordered">
- <?php $query=mysql_query("select * from up_files")or die(mysql_error());
- <?php } ?>
Let's try this one.
We are going to select a file that we are going to upload, enter the file name, and enter the file description as shown in the image below.
After that, we are going to click the "Upload" button to save into the database table as you can see in the image below.
Kindly click the "Download Code" button below for full source code. Thank you very much.
Hope that this tutorial will help you a lot.
Share us your thoughts and comments below. Thank you so much for dropping by and reading this tutorial post. For more updates, don’t hesitate and feel free to visit this website more often and please share this with your friends or email me at [email protected]. Practice Coding. Thank you very much.