有人知道如何tui-fileuploader表单提交数据吗?

时间:2019-07-04 09:04:28

标签: file-upload toast-ui-editor

我正在使用tui-uploader库实现文件上传,但是我遇到了很大的问题,希望获得帮助。 输入类型的文本和内容远远超出了sumbit url调用形式的值,selectbox的选项值未传递数据。 仅打印空日志。 如果您知道如何使用tui-fileuploader,请分享。 我使用了基本的示例示例 下面是我的代码。

// Write example code
<script>
$(function(){
   var uploader = new tui.FileUploader($('#uploader'), {
	  url: {
	          send: "http://localhost:8090/community/createFile",
	         },
	     redirectURL: 'http://localhost:8090/community/resources',
	      isMultiple: true,
	      isBatchTransfer: true,
	      listUI: {
	      type: 'table',
	                 columnList: [
	                     {
	                         header: '{{checkbox}}',
	                         body: '{{checkbox}}',
	                         width: 32
	                     },
	                     {
	                         header: 'File Name',
	                         body: '<span class="tui-filename-area"><span class="tui-file-name" style="max-width:480px;">{{filename}}</span></span>',
	                         width: 500
	                     },
	                     {
	                         header: 'File Size',
	                         body: '{{filesize}}'
	                     }
	                 ]
	         }
     });
});
</script>   
<div class="file-uploader-wrapper" style="width: 100%">
      <div id="uploader" class="tui-file-uploader">
<table class="form_tbl">
    <tbody>
	<tr>
		<th class="star">Title</th>
		<td><input type="text" name="title" id="title" class="inp w100" required/></td>
	</tr>
	<tr>
		<th class="star">Solution</th>
		<td>
			<select name="solution_type" id="solution_type">
				<option value="">choose one.</option>
				<option value="1">TEST01</option>
				<option value="2">TEST02</option>
				<option value="3">TEST03</option>
				<option value="4">TEST04</option>
				<option value="5">TEST05</option>
			</select>
		</td>
	</tr>
	<tr>
		<th class="star">contents</th>
		<td><textarea name="contents" id="contents" cols="30" rows="10" required></textarea>
		</td>
	</tr>
	<tr>
		<th>add file</th>
                <td>
					<div class="tui-file-uploader-header">
						  <div class="tui-btn-area">
							  <button type="button" class="tui-btn tui-btn-cancel tui-is-disabled" disabled>Remove</button>
							<label class="tui-btn tui-btn-upload">
								<span class="tui-btn-txt">Add Files</span>
							   <input type="file" name="userfile[]" class="tui-input-file">
							</label>
							</div>
				   </div>
					<div class="tui-js-file-uploader-list tui-js-file-uploader-dropzone tui-file-uploader-area tui-has-scroll">
					         <div class="tui-dropzone-contents">
						       <span class="tui-dropzone-msg">Drop files here.</span>
							 </div>
					</div>
					<div class="tui-file-uploader-info">
							<span class="tui-info-txt">Selected <em class="tui-spec"><span id="checkedItemCount">0</span> files</em> (<span id="checkedItemSize">0 KB</span>)</span>
							<span class="tui-info-txt">Total <span id="itemTotalSize">0 KB</span></span>
					</div>
				</td>
		</tr>
	</tbody>
</table>

0 个答案:

没有答案