porfavor posten codigo para guiarme. gracias a todos de antemano

|
|
#1 (permalink) |
![]() Fecha de Ingreso: febrero-2008
Mensajes: 42
|
porfavor posten codigo para guiarme. gracias a todos de antemano ![]() |
|
|
|
|
|
#2 (permalink) |
![]() |
Re: subir imagen ayudita porfavor
pues deberias tener algo asi
if( string.IsNullOrEmpty( fileupload.Filename)) { // Esto devuelve la raiz de tu sitio imagen= Server.MapPath("~/")+rutaimagendefault; } else { fileupload.Save(....) }
__________________
Saludos Peterpay MCPD Enterprise Applications |
|
|
|
|
|
#4 (permalink) |
![]() |
Re: subir imagen ayudita porfavor
el fileupload es de tu archivo seleccionado desde tu web, pero si no se selecciono nada queires q por default se guarde una imagen ahi entras tu diciendo q si nohay archivo seleccionado le des por default uno q esta en tu servidor
__________________
Saludos Peterpay MCPD Enterprise Applications |
|
|
|
|
|
#5 (permalink) |
![]() Fecha de Ingreso: febrero-2008
Mensajes: 42
|
mira esto es lo que quiero realizar ....
Código:
como seria el codigo para capturar la imagen por defecto en el servidor y devolver un byte gracias............Public Function GetBitImg(ByVal img As FileUpload, ByVal txt As TextBox) As Byte()
If txt.Text = "" Then
// aca estaria el codigo para la imagen default
Else
//aca tomo lo que trae el fileupload y me devuelve un byte para luego insertarlo en la bd ....
Dim httpimg As HttpPostedFile = img.PostedFile
Dim bit(img.PostedFile.InputStream.Length + 1) As Byte
httpimg.InputStream.Read(bit, 0, img.PostedFile.ContentLength)
Return bit
End If
End Function
|
|
|
|
|
|
#6 (permalink) |
![]() |
Re: subir imagen ayudita porfavor
en esa parte define el BinaryStream desde tu archivo ubicado en Server.MapPath(~)
rutapordefault=Server.MapPath("~")+folderdondestat uimagendefault; FileStream stream = new FileStream(rutapordefault, FileMode.Open); BinaryReader reader = new BinaryReader(stream); byte[]file= reader.ReadBytes(stream.Length); reader.Close();
__________________
Saludos Peterpay MCPD Enterprise Applications |
|
|
|