while uploading Photo,not seen in IE7 but seen in IE6
-
how to resolve compatibilty problem with IE7,this code also makes duplicate copies of photo in my image folder,how to resolve dat problem too,i am uploading the photo by using this code-:
static byte\[\] bydoctemp; static Int32 intDocLength\_img = 0; Stream objStream\_img;
protected void bttn_upload_photo_Click(object sender, EventArgs e)
{
intDocLength_img = FileUpload1.PostedFile.ContentLength;bydoctemp = new byte\[intDocLength\_img\]; objStream\_img = FileUpload1.PostedFile.InputStream; objStream\_img.Read(bydoctemp, 0, intDocLength\_img);
previewField.Attributes.Add("src", FileUpload1.PostedFile.FileName);
private static string RandomString()
{
int size = 10;
Random r = new Random();
string legalChars = "abcdefghijklmnopqrstuvwxzyABCDEFGHIJKLMNOPQRSTUVWXZY123456789";
StringBuilder sb = new StringBuilder();
for (int i = 0; i < size; i++)
sb.Append(legalChars.Substring(r.Next(0, legalChars.Length - 1), 1));
return sb.ToString();
}private long m\_lImageFileLength = 0; private byte\[\] m\_barrImg; public byte\[\] load\_binary(string filepath) { if (filepath.Trim() != "") { FileInfo fiImage = new FileInfo(filepath); this.m\_lImageFileLength = fiImage.Length; FileStream fs = new FileStream(filepath, FileMode.Open, FileAccess.Read, FileShare.Read); m\_barrImg = new byte\[Convert.ToInt32(this.m\_lImageFileLength)\]; int iBytesRead = fs.Read(m\_barrImg, 0, Convert.ToInt32(this.m\_lImageFileLength)); fs.Close(); } else { m\_barrImg = new byte\[0\]; } return m\_barrImg; }
//storing in database
//upload
if (intDocLength_img > 1)
{
cmd.Parameters[68].Value = bydoctemp;} else { HF1.Value = ""; cmd.Parameters\[68\].Value = load\_binary(HF1.Value); previewField.Attributes.Add("src", "..\\\\layout\_images\\\\Untitled-1.gif"); }
can anyone have the code for uploading photo in asp.net dat is fully compatible with IE6 as well as IE7,thanks in advance
Maniiiiiiiiiiiiiii
-
how to resolve compatibilty problem with IE7,this code also makes duplicate copies of photo in my image folder,how to resolve dat problem too,i am uploading the photo by using this code-:
static byte\[\] bydoctemp; static Int32 intDocLength\_img = 0; Stream objStream\_img;
protected void bttn_upload_photo_Click(object sender, EventArgs e)
{
intDocLength_img = FileUpload1.PostedFile.ContentLength;bydoctemp = new byte\[intDocLength\_img\]; objStream\_img = FileUpload1.PostedFile.InputStream; objStream\_img.Read(bydoctemp, 0, intDocLength\_img);
previewField.Attributes.Add("src", FileUpload1.PostedFile.FileName);
private static string RandomString()
{
int size = 10;
Random r = new Random();
string legalChars = "abcdefghijklmnopqrstuvwxzyABCDEFGHIJKLMNOPQRSTUVWXZY123456789";
StringBuilder sb = new StringBuilder();
for (int i = 0; i < size; i++)
sb.Append(legalChars.Substring(r.Next(0, legalChars.Length - 1), 1));
return sb.ToString();
}private long m\_lImageFileLength = 0; private byte\[\] m\_barrImg; public byte\[\] load\_binary(string filepath) { if (filepath.Trim() != "") { FileInfo fiImage = new FileInfo(filepath); this.m\_lImageFileLength = fiImage.Length; FileStream fs = new FileStream(filepath, FileMode.Open, FileAccess.Read, FileShare.Read); m\_barrImg = new byte\[Convert.ToInt32(this.m\_lImageFileLength)\]; int iBytesRead = fs.Read(m\_barrImg, 0, Convert.ToInt32(this.m\_lImageFileLength)); fs.Close(); } else { m\_barrImg = new byte\[0\]; } return m\_barrImg; }
//storing in database
//upload
if (intDocLength_img > 1)
{
cmd.Parameters[68].Value = bydoctemp;} else { HF1.Value = ""; cmd.Parameters\[68\].Value = load\_binary(HF1.Value); previewField.Attributes.Add("src", "..\\\\layout\_images\\\\Untitled-1.gif"); }
can anyone have the code for uploading photo in asp.net dat is fully compatible with IE6 as well as IE7,thanks in advance
Maniiiiiiiiiiiiiii
-
rename the pic manually so when it make the pic it override it
The Web Developer. Beirout-Lebanon
i dont understand,can u plz explain it as how should i do it...
Maniiiiiiiiiiiiiii