Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. $(document).ready(function(){
  2. //alert('I am Ready!');
  3. $("#file_upload").uploadify({
  4. 'debug' : true,
  5. 'uploader': 'uploadify.swf',
  6. 'cancelImg': 'cancel.png',
  7. 'auto': false,
  8. 'multi' :true,
  9. 'method' : 'post',
  10. 'postData' : {},
  11. 'queueSizeLimit' : 10,
  12. 'onQueueFull' : function(event, queueSizeLimit){
  13. alert(" You can upload " + queueSizeLimit + " files at once");
  14. return false;
  15. },
  16. 'onComplete': function(event, ID, fileObj, response, data) {
  17. var album_id = $("#album_id").val();
  18. $.post("insert.php", {
  19. name: fileObj.name,
  20. path: fileObj.filePath,
  21. size: fileObj.size,
  22. album_id:album_id},
  23. function(info){
  24. alert(info);
  25. });
  26. }
  27. });
  28. });
  29. </script>
  30. </head>
  31.  
  32. <body>
  33. <form method="post" action="">
  34. <input type="file" name="file_upload" id="file_upload" />
  35. <select id="album_id" name="album_id">
  36. <option value="1">First type</option>
  37. <option value="2">Second type</option>
  38. </select>
  39. <a href="javascript:$('#file_upload').uploadifyUpload();">Upload File</a>
  40.  
  41. </form>
  42. </body>
  43. </html>
  44.  
  45. var album_id = $("#album_id option:selected").val();
  46.  
  47. $.post("insert.php", { "name": fileObj.name, "path": fileObj.filePath, "size": fileObj.size, "album_id":album_id}, function(info){
  48.  
  49. 'scriptData': {'name':'JohnDoe', 'location':'Australia'},
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement