i want to upload image using uploadify and after image get upload it should be shown which image i have uploaded
http://www.uploadify.com/demos/
here is the demo which is working but the problem is it is not showing image which i have selected
want mulitple selection also
i want to perfrom using jquery js
$("#<%=fuUpload.ClientID %>").uploadify({
'uploader': 'uploadify/uploadify.swf',
'cancelImg': 'uploadify/cancel.png',
'buttonText': 'Browse Files',
'script': 'uploadimage.aspx?cid=images/CompProfile/',
'folder': '/images/ProductImage',
'fileDesc': 'All Files',
'multi': true,
'auto': true,
'onSelect': function (file) {
},
'onCancel': function (file) {
},
'onComplete': function (event, ID, file, response, data) {
$(".fileUploadSuccess").append("<div>" + file.name + " is uploaded!!</div>")
var a = document.createElement("img");
alert();
a.src = "Close.png";
alert();
a.height = 100;
a.width = 100;
alert();
}
});
$(".fuUpload").change(function () {
var ID = $(this).attr("data-image-id");
$("." + ID).html("");
var regex = /^([a-zA-Z0-9\s_\\.\-:])+(.jpg|.jpeg|.gif|.png|.bmp)$/;
if (regex.test($(this).val().toLowerCase())) {
if ($.browser.msie && parseFloat(jQuery.browser.version) <= 9.0) {
$("." + ID).show();
$("." + ID)[0].filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = $(this).val();
}
else {
if (typeof (FileReader) != "undefined") {
$("." + ID).show();
$("." + ID).append("<a target='_blank'><img /></a>");
var reader = new FileReader();
reader.onload = function (e) {
$("." + ID + " img").attr("src", e.target.result);
$("." + ID + " a").attr("href", e.target.result);
}
$("." + ID).addClass("newCs");
reader.readAsDataURL($(this)[0].files[0]);
} else {
alert("This browser does not support FileReader.");
}
}
} else {
}
});
<asp:FileUpload ID="fuPhoto" runat="server" CssClass="fuUpload form-control" data-image-id="PhotoImage" />
if (fuPhoto.HasFile)
{
string FName = fuPhoto.FileName.ToString();
int Index = FName.IndexOf('.');
string ImageName = FName.Substring(0, Index);
string ImgExtension = FName.Substring(Index);
}
clscompanyprofile objCompany = new clscompanyprofile(true);
objCompany.Update(Id, txtCompanyName.Text, Convert.ToDateTime(txtDOI.Text), txtCIN.Text, txtRegsAddress.Text, txtCorpAddress.Text, txtEmailID.Text, txtWebsite.Text, txtContact.Text, txtPANNo.Text, txtDrugLicence.Text, txtGSTTIN.Text, txtCSTTIN.Text, txtIEC.Text, txtTANNo.Text, txtISO90012008.Text, Convert.ToDateTime(txtExpiredDate.Text), txtBankName.Text, txtAcName.Text, txtAcNo.Text, txtAcType.Text, txtIFCSCode.Text, txtBankName.Text, txtSwiftCode.Text, txtBankName2.Text, txtAcName2.Text, txtAcNo2.Text, txtAcType2.Text, txtIFCSCode2.Text, txtBankName2.Text, txtSwiftCode2.Text, txtBankName3.Text, txtAcName3.Text, txtAcNo3.Text, txtAcType3.Text, txtIFCSCode3.Text, txtBankName3.Text, txtSwiftCode3.Text);
if (fuPhoto.HasFile)
{
Stream strm = fuPhoto.PostedFile.InputStream;
if (!Directory.Exists(Server.MapPath("images/Company")))
Directory.CreateDirectory(Server.MapPath("images/Company"));
clsCommanSetting.GenerateThumbnails(strm, "images/Company/" + txtCompanyName.Text + ".jpg", 600, 600);
}