Ver Mensaje Individual
  #5 (permalink)  
Antiguo 13/08/2004, 05:47
Avatar de luiscl
luiscl
 
Fecha de Ingreso: abril-2004
Ubicación: Zaragoza
Mensajes: 305
Antigüedad: 20 años, 1 mes
Puntos: 0
Yo, aunque en un web form, lo hago de la siguiente manera, aunque seguro que lo que te ha pasado RootK es más sencillo y más claro. Yo soy un chapucero nato...

'Créate un HtmlInputFile para que te permita buscar el fichero que quieres subir:

Protected WithEvents File1 As System.Web.UI.HtmlControls.HtmlInputFile

'Luego, el código (yo guardo el fichero en un directorio que creo dinámicamente, y que se llama tal y como tengo guardado en el label lblidentificadorrecuperado.Text. A su vez guardo el contenido de este label en una variable, varidentificador, porque me daba algún error que no recuerdo si no hacía este paso intermedio)

If Not File1.PostedFile Is Nothing And File1.PostedFile.ContentLength > 0 Then
Dim fn As String = System.IO.Path.GetFileName(File1.PostedFile.FileNa me)
Dim varidentificador As String

varidentificador = lblidentificadorrecuperado.Text
Dim Ruta As String = Server.MapPath("Subir\") & varidentificador
Dim directorio As DirectoryInfo = Directory.CreateDirectory(Ruta)

Dim SaveLocation As String = Server.MapPath("Subir") & "\" & varidentificador & "\" & fn

'Y luego ya guardas el archivo


File1.PostedFile.SaveAs(SaveLocation)

Espero que te ayude

Un saludo
__________________
Pide lo que quieras...y luego paga por ello