Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function(){
- //alert('I am Ready!');
- $("#file_upload").uploadify({
- 'debug' : true,
- 'uploader': 'uploadify.swf',
- 'cancelImg': 'cancel.png',
- 'auto': false,
- 'multi' :true,
- 'method' : 'post',
- 'postData' : {},
- 'queueSizeLimit' : 10,
- 'onQueueFull' : function(event, queueSizeLimit){
- alert(" You can upload " + queueSizeLimit + " files at once");
- return false;
- },
- 'onComplete': function(event, ID, fileObj, response, data) {
- var album_id = $("#album_id").val();
- $.post("insert.php", {
- name: fileObj.name,
- path: fileObj.filePath,
- size: fileObj.size,
- album_id:album_id},
- function(info){
- alert(info);
- });
- }
- });
- });
- </script>
- </head>
- <body>
- <form method="post" action="">
- <input type="file" name="file_upload" id="file_upload" />
- <select id="album_id" name="album_id">
- <option value="1">First type</option>
- <option value="2">Second type</option>
- </select>
- <a href="javascript:$('#file_upload').uploadifyUpload();">Upload File</a>
- </form>
- </body>
- </html>
- var album_id = $("#album_id option:selected").val();
- $.post("insert.php", { "name": fileObj.name, "path": fileObj.filePath, "size": fileObj.size, "album_id":album_id}, function(info){
- 'scriptData': {'name':'JohnDoe', 'location':'Australia'},
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement