0
내 작업에 문제가 있습니다. asp.net mvc 프로젝트를 만들고 서버에 이미지를 업로드합니다. 업로드의 경우 swfupload를 사용합니다. 업 로더를 만들 수있는 코드가 있습니다.업 로더 이미지. JQuery
<script>
$(function() {
$("#photo").makeAsyncUploader({
upload_url: "/Home/AsyncUpload/<%= ViewData["guid"]%>",
flash_url: '/Scripts/swfupload.swf',
button_image_url: '/Content/blankButton.png',
disableDuringUpload: 'INPUT[type="submit"]'
});
});
</script>
"photo"라는 버튼이 하나 있습니다. 그것은이 작동
<input type="button" onclick="add()" value="Add new button"/>
<script type="text/javascript">
function add() {
var newelement = document.createElement('p');
newelement.setAttribute("class", "file_input");
var x = ((document.getElementById('uploadImage').getElementsByTagName('p').length));
var fileinput = document.createElement('input');
fileinput.setAttribute("name", "photo" + x);
fileinput.setAttribute("type", "file");
newelement.appendChild(fileinput);
document.getElementById('uploadImage').appendChild(new_element);
}
</script>
: 그러나 추가 새로운 입력을 div에하는 나는 스크립트를 생성 ... "이름"사진 1 "" '사진으로 더 많은 버튼이 있어야합니다. 그리고 내 div에 버튼을 추가하십시오
<div id="uploadImage">
<p>Photo: <input type="file" id="photo" name="photo"/> </p>
</div>
나는 질문을 가지고, 그게 내가 swfupload 것입니다 새 버튼을 추가 할 스크립트해야합니다. 고맙고 미안하다. 내가 제대로 질문을 이해하면
예. 고맙습니다. – user3104632