วิธีทำ แก้ปัญหา upload file แบบ multi file

  • เริ่มกระทู้โดย admin
  • วันที่เริ่มกระทู้
  • ตอบ 0
  • อ่าน 1K

admin

Administrator
Staff Member
admin
อ้างอิงจาก YUI Security Issue found in uploader.swf

adding a `multiple` attribute for the file input elements:
In the `assetmanager` template, find
HTML:
<input id="firstuploadinput" type="file" class="bginput uploadinput" name="attachment[]" size="30" tabindex="1" />
and replace it by
HTML:
<input id="firstuploadinput" type="file" class="bginput uploadinput" name="attachment[]" size="30" tabindex="1" multiple />
In the `editor_upload_overlay` template, find
HTML:
<input id="fileupload1" class="textbox" type="file" size="30" name="attachment[]" tabindex="1" />
and replace it by
HTML:
<input id="fileupload1" class="textbox" type="file" size="30" name="attachment[]" tabindex="1" multiple />
This will allow users with modern (HTML5 compliant) browsers to select multiple files for uploading by using the usual file picker dialog of their operating system (holding the ctrl/shift keys to select multiple files). No code changes or plugins are required for this to work, since vBulletin is ready to process multiple uploads at once. If an user selects more files than the limit you specified in the option named above, extra uploads will fail.
 


ด้านบน