Visual Basic.NET - DESCARGAR ARCHIVO DE BASE DE DATOS

 
Vista:
Imágen de perfil de Luis Angel

DESCARGAR ARCHIVO DE BASE DE DATOS

Publicado por Luis Angel (3 intervenciones) el 05/09/2014 22:55:37
Tengo un problema al descargar un archivo guardado en bytes en mi base de datos desde una maquina cliente.

este el procedimiento que uso para descargar el archivo.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Dim OTABLE As DataTable
 
        OTABLE = control.Buscar_Archivo(CInt(dgvingreso.SelectedRow.Cells(1).Text))
        Dim result As Byte() = OTABLE.Rows(0).Item(0)
        Dim extension As String = OTABLE.Rows(0).Item(1)
        Select Case extension
            Case "image/doc"
                File.WriteAllBytes("c:\archivo.doc", result)
            Case "image/docx"
                File.WriteAllBytes("c:\archivo.docx", result)
            Case "image/jpeg"
                File.WriteAllBytes("c:\archivo.jpg", result)
            Case "image/pdf"
                File.WriteAllBytes("c:\archivo.pdf", result)
        End Select


Cuando ejecuto en el servidor no me sale ningun problema y me lo descarga normal, pero en el cliente me sale este error.

Server Error in '/Produccion' Application.

Access to the path 'c:\archivo.docx' is denied.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.UnauthorizedAccessException: Access to the path 'c:\archivo.docx' is denied.

Sin_titulo

ES URGENTE PORFAVOR NECESITO SU AYUDA
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
sin imagen de perfil

DESCARGAR ARCHIVO DE BASE DE DATOS

Publicado por Pico (167 intervenciones) el 06/09/2014 15:50:24
Si te sale que el cliente no tiene permiso de acceso al archivo es que el cliente no tiene permiso de acceso al cliente. No se le puede dar más vueltas. El servidor sí lo tiene. Dáselo al cliente....
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar