Guest User

Untitled

a guest
Jun 18th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.95 KB | None | 0 0
  1. $(document).ready(function () {
  2. // Multiple files - single input
  3. $("#multipleFiles").uploadify({
  4. /*=========================*/
  5. 'uploader': '<?= $this->config->multiUpload['uploader']; ?>',
  6. 'script': '<?= $this->config->multiUpload['script']; ?>',
  7. 'checkScript': '<?= $this->config->multiUpload['checkScript']; ?>',
  8. 'fileDataName': '<?= $this->config->multiUpload['fileDataName']; ?>',
  9. 'folder': '<?= $this->config->multiUpload['folder']; ?>',
  10. 'fileExt' : '<?= $this->config->multiUpload['fileExt']; ?>',
  11. 'buttonText': '<?= $this->config->multiUpload['buttonText']; ?>',
  12. 'sizeLimit': <?= $this->config->multiUpload['sizeLimit']; ?>,
  13. 'simUploadLimit': <?= $this->config->multiUpload['simUploadLimit']; ?>,
  14. 'cancelImg': '<?= $this->config->multiUpload['cancelImg']; ?>',
  15. 'displayData': '<?= $this->config->multiUpload['displayData']; ?>',
  16. 'auto': <?= $this->config->multiUpload['auto']; ?>,
  17. 'multi': <?= $this->config->multiUpload['multi']; ?>,
  18.  
  19. /*=========================*/
  20. 'scriptData': {'name': 'test'},
  21.  
  22. /*=========================*/
  23. 'onError': function (a, b, c, d) {
  24. if (d.status == 404)
  25. alert("Nie można odnaleźć uploadera. Użyj ścieżki względnej do: " + "<?= getcwd() ?>");
  26. else if (d.type === "HTTP")
  27. alert("error " + d.type + ": " + d.status);
  28. else if (d.type === "File Size")
  29. alert(c.name + " " + d.type + " Limit: " + Math.round(d.info / (1024 * 1024)) + "MB");
  30. else
  31. alert("error " + d.type + ": " + d.text);
  32. },
  33.  
  34. /*=========================*/
  35. 'onComplete': function (event, queueId, fileObj, response, data) {
  36. alert(response);
  37. }
  38.  
  39. });
  40.  
  41. /*=========================*/
  42. $("#btn1").click(function () {
  43. $('#multipleFiles').uploadifyUpload();
  44. });
  45.  
  46. /*=========================*/
  47. $('#name').bind('change', function(){
  48. $('#multipleFiles').uploadifySettings('scriptData', { 'name' : $(this).val(), 'type' : $(this).val() });
  49. });
  50.  
  51. });
Add Comment
Please, Sign In to add comment