나는 업로드 컨트롤과 이미지 상자가 있습니다. 이미지를 업로드 할 때 이미지를 상자에 표시해야합니다. 내 이미지가 업로드되지만 상자에 표시되지 않습니다.업로드 이미지 ASP.NET
업로드 된 이미지의 경로는 다음과 같이 반환됩니다.
~/사진/학생/Student1.jpg
어떻게
로 경로를 얻을 수 있습니까사진/학생/Student1.jpg 업로드에 대한 나의 클라이언트 측 기능이
입니다 다음과 같이 당신의 FileUpload.ashx에서
$.ajaxFileUpload({
url: 'FileUpload.ashx?id=' + FileFolder + '&Mainfolder=Photos' + '&parentfolder=Student',
secureuri: false,
fileElementId: 'uplPhoto',
dataType: 'json',
success: function (data, status) {
if (typeof (data.error) != 'undefined') {
if (data.error != '') {
alert(data.error);
} else {
$('#hdnFullPhotoPath').val(data.upfile);
$('#uplPhoto').val("");
$('#lblPhotoName').text('Photo uploaded successfully')
$('#Image1').attr('src', data.upfile);
alert(data.upfile);
}
}
},
error: function (data, status, e) {
alert(e);
}
});
}
else {
alert('The photo ' + filename + ' already exists');
return false;
}
}
}
else {
alert('You can upload only jpg,jpeg,pdf,doc,docx,txt,zip,rar extensions files.');
}
return false;
}
@ Aishvarya- 당신은 어디에서 그 길을 가고 싶습니까? – coder
@ 코더, 이미지 상자에 업로드 된 이미지를 표시해야합니다. – MusicLovingIndianGirl
서버 측 코드를 제공 할 수 있습니까? – Nirmal