locked
upload + resize RRS feed

  • Question

  • User1747683779 posted
    i'll see that in this forum there's different discussion about this, but i don't understand how to use it (sorry but i'm new of .net plattaform)ù So i'll try to write with the upload function .... for undestande it with an my axample. Someone can help me to implement to the upload script with the functionality of save (in the specific folder) and resize image (with save the proportion) to a value of 450x450 ?? Thanks in advanced. Enrico if (Foto.PostedFile != null) { try { HttpPostedFile File_Foto = Foto.PostedFile; string FileName_Foto = Path.GetFileName(File_Foto.FileName); int FileLen_Foto = File_Foto.ContentLength; if (FileLen_Foto > 1000000) // Check for Maximum File Length { lblMessage.Text = "Foto - (1000000 Bytes)"; return false; } if (FileLen_Foto > 0) { Stream Stream_Foto = File_Foto.InputStream; FileName_Foto = ewdb.ewUploadFileName(FileName_Foto); File_Foto.SaveAs (Server.MapPath("images/" + FileName_Foto)); oCmd.Parameters.Add("@Foto",OleDbType.VarWChar,255).Value = FileName_Foto; } } catch (Exception oErr) // Error Handling {} } that call this public string ewUploadFileName(string sFileName) { string sOutFileName; // Amend your logic here sOutFileName = sFileName; // Return computed output file name return sOutFileName; } // End ewUploadFileName
    Tuesday, October 12, 2004 5:43 AM

All replies