We have enough way to upload multiple files in PHP, either you use your own script or use third party application. In the same regards I am using Uploadify to upload multiple files. There are some basic and easy steps which will help you to save your time
About Uploadify
Uploadify is a jQuery plugin that integrates a fully-customizable multiple file upload utility on your website. It uses a mixture of Javascript, ActionScript, and any server-side language to dynamically create an instance over any DOM element on a page.
Features
- jQuery Implementation
- Multiple File Upload Capabilities
- SWFObject Integration
- Compatibility with Popular Server-Side Languages
- Highly-Customizable
- Large Support Community
- Extensive Documentation with Examples
Click here to more information or download Uploadify
Step #1 – Head
Okay! Now we start with the basic procedures, add CSS, Javascripts and Uploadify configuration in head section.
<!-- CSS --> <link rel="stylesheet" href="uploadifyit/uploadify.css" type="text/css" /> <!-- Javascript --> <script type="text/javascript" src="uploadifyit/jquery-1.4.2.min.js"></script> <script type="text/javascript" src="uploadifyit/swfobject.js"></script> <script type="text/javascript" src="uploadifyit/jquery.uploadify.v2.1.4.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
//alert('I am ready to use uploadify!');
$("#file_upload").uploadify({
'uploader': 'uploadifyit/uploadify.swf',
'script': 'uploadifyit/uploadify.php',
'cancelImg': 'uploadifyit/cancel.png',
'folder': 'uploads',
'auto': false, // use for auto upload
'multi': true,
'queueSizeLimit': 2,
'onQueueFull': function(event, queueSizeLimit) {
alert("Please don't put anymore files in me! You can upload " + queueSizeLimit + " files at once");
return false;
},
'onComplete': function(event, ID, fileObj, response, data) {
alert("Filename: " + fileObj.name + "\nSize: " + fileObj.size + "\nFilepath: " + fileObj.filePath);
// you can use here jQuery AJAX method to send info at server-side.
}
});
});
</script>
Step #2 – Body
After the add code into head section, we have to just add a little code into Body, here is your code
<form id="form1" name="form1" action="">
<input type="file" id="file_upload" name="file_upload" /><br />
<a href="javascript:$('#file_upload').uploadifyUpload();">Upload File</a>
</form>
Alright. You can see the video, I hope it would be brief you much to use Uploadify in your projects.
Thank you!
Popularity: 18%







Comments on this entry (12 comments)
Did you like this post? You can share your opinion with us! Simply click here.