1.在模態框裏寫文件的上傳
2.修改input爲file的樣式
默認是“選擇文件”,直接在後面顯示文件的名字
解決:修改樣式
方法如下:
<form action="http://localhost:8080/GD/UploadAction_execute.action" method="post" enctype="multipart/form-data" name="uploadfile">
<input type="file" name="my" id="file" value="瀏覽" style="display: none;" οnchange="document.uploadfile.filePath.value=this.value"/>
<input type="text" name="filePath" id="filePath"/>
<input type="button" value="瀏覽..." οnclick="document.uploadfile.my.click()"/><br>
<input type="submit" value="上傳" id="shangchuan">
</form>