w_uploadify.html 4.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <h2 class="contentTitle">uploadify多文件上传</h2>
  2. <style type="text/css" media="screen">
  3. .my-uploadify-button {
  4. background:none;
  5. border: none;
  6. text-shadow: none;
  7. border-radius:0;
  8. }
  9. .uploadify:hover .my-uploadify-button {
  10. background:none;
  11. border: none;
  12. }
  13. .fileQueue {
  14. width: 400px;
  15. height: 150px;
  16. overflow: auto;
  17. border: 1px solid #E5E5E5;
  18. margin-bottom: 10px;
  19. }
  20. </style>
  21. <div class="pageContent" style="margin: 0 10px" layoutH="50">
  22. <input id="testFileInput" type="file" name="image"
  23. uploaderOption="{
  24. swf:'uploadify/scripts/uploadify.swf',
  25. uploader:'demo/common/ajaxDone.html',
  26. formData:{PHPSESSID:'xxx', ajax:1},
  27. buttonText:'请选择文件',
  28. fileSizeLimit:'200KB',
  29. fileTypeDesc:'*.jpg;*.jpeg;*.gif;*.png;',
  30. fileTypeExts:'*.jpg;*.jpeg;*.gif;*.png;',
  31. auto:true,
  32. multi:true,
  33. onUploadSuccess:uploadifySuccess,
  34. onQueueComplete:uploadifyQueueComplete
  35. }"
  36. />
  37. <div class="divider"></div>
  38. <input id="testFileInput2" type="file" name="image2"
  39. uploaderOption="{
  40. swf:'uploadify/scripts/uploadify.swf',
  41. uploader:'demo/common/ajaxDone.html',
  42. formData:{PHPSESSID:'xxx', ajax:1},
  43. queueID:'fileQueue',
  44. buttonImage:'uploadify/img/add.jpg',
  45. buttonClass:'my-uploadify-button',
  46. width:102,
  47. auto:false
  48. }"
  49. />
  50. <div id="fileQueue" class="fileQueue"></div>
  51. <input type="image" src="uploadify/img/upload.jpg" onclick="$('#testFileInput2').uploadify('upload', '*');"/>
  52. <input type="image" src="uploadify/img/cancel.jpg" onclick="$('#testFileInput2').uploadify('cancel', '*');"/>
  53. <div class="divider"></div>
  54. <p style="margin:10px"><a href="http://www.uploadify.com/documentation/" target="_blank">Uploadify 在线文档</a></p>
  55. <textarea cols="160" rows="10">
  56. uploaderOption: http://www.uploadify.com/documentation/
  57. auto : true, // Automatically upload files when added to the queue
  58. buttonClass : '', // A class name to add to the browse button DOM object
  59. buttonCursor : 'hand', // The cursor to use with the browse button
  60. buttonImage : null, // (String or null) The path to an image to use for the Flash browse button if not using CSS to style the button
  61. buttonText : 'SELECT FILES', // The text to use for the browse button
  62. checkExisting : false, // The path to a server-side script that checks for existing files on the server
  63. debug : false, // Turn on swfUpload debugging mode
  64. fileObjName : 'Filedata', // The name of the file object to use in your server-side script
  65. fileSizeLimit : 0, // The maximum size of an uploadable file in KB (Accepts units B KB MB GB if string, 0 for no limit)
  66. fileTypeDesc : 'All Files', // The description for file types in the browse dialog
  67. fileTypeExts : '*.*', // Allowed extensions in the browse dialog (server-side validation should also be used)
  68. height : 30, // The height of the browse button
  69. itemTemplate : false, // The template for the file item in the queue
  70. method : 'post', // The method to use when sending files to the server-side upload script
  71. multi : true, // Allow multiple file selection in the browse dialog
  72. formData : {}, // An object with additional data to send to the server-side upload script with every file upload
  73. preventCaching : true, // Adds a random value to the Flash URL to prevent caching of it (conflicts with existing parameters)
  74. progressData : 'percentage', // ('percentage' or 'speed') Data to show in the queue item during a file upload
  75. queueID : false, // The ID of the DOM object to use as a file queue (without the #)
  76. queueSizeLimit : 999, // The maximum number of files that can be in the queue at one time
  77. removeCompleted : true, // Remove queue items from the queue when they are done uploading
  78. removeTimeout : 3, // The delay in seconds before removing a queue item if removeCompleted is set to true
  79. requeueErrors : false, // Keep errored files in the queue and keep trying to upload them
  80. successTimeout : 30, // The number of seconds to wait for Flash to detect the server's response after the file has finished uploading
  81. uploadLimit : 0, // The maximum number of files you can upload
  82. width : 120, // The width of the browse button
  83. </textarea>
  84. </div>