Wrox Programmer Forums
|
VB.NET General VB.NET discussions for issues that don't fall into other VB.NET forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 13th, 2005, 07:19 AM
Registered User
 
Join Date: Oct 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to wcoliveira Send a message via MSN to wcoliveira
Default Ajuda em UPLOAD

Escrevi código para realizar upload de imgs e exibí-las em grid, dá a
mensagem de sucesso, mas qdo procuro a img na pasta ela não esta... o que
posso fazer???

O código esta abaixo.. Por favor me ajudem...
----------------------------------------------------------------------------------------------
Sub upload (Sender as Object, e as EventArgs)
        Dim strNomeArquivo as string
        strNomeArquivo = MyFile.PostedFile.FileName
        Dim NomeArquivo as string = System.IO.Path.GetFileName(strNomeArquivo)

        Try
            MyFile.PostedFile.SaveAs("c:\InetPub\wwwroot\Sepla ntec\Siag\Imagens\upload\" + Request.Cookies("SIAG_ISN_PROJETO").value + "_" + NomeArquivo)
            vsg_Isn_Tabela = vog_Conexao.ExecSQl("Select S_ACOMP_PROJETO_IMG.nextval
as ISN_TABELA From dual ", "ISN_TABELA").ToString()
            vsl_Sql = "Insert Into T_ACOMP_PROJETO_IMG ("
            vsl_Sql += " ISN_ACOMP_PROJETO_IMG, "
            vsl_Sql += " ISN_PROJETO, "
            vsl_Sql += " ISN_ACOMP_PROJETO, "
            vsl_Sql += " COD_MES, "
            vsl_Sql += " DSC_PATH_ARQUIVO, "
            vsl_Sql += " DSC_ARQUIVO) "
            vsl_Sql += " values "
            vsl_Sql += "(" & vsg_Isn_Tabela & ","
            vsl_Sql += "" & Request.Cookies("SIAG_ISN_PROJETO").value & ","
            vsl_Sql += "" & Request.Cookies("SIAG_ISN_ACOMP_PROJETO").value & ","
            vsl_Sql += "" & ddl_COD_MES.selecteditem.value & ","
            vsl_Sql += "'" & "c:\InetPub\wwwroot\Seplantec\Siag\Imagens\upload\ " +
Request.Cookies("SIAG_ISN_PROJETO").value + "_" + NomeArquivo & "',"
            vsl_Sql += "'" & NomeArquivo & "') "
            if vog_Conexao Is Nothing Then
                vog_Conexao = New Conexao()
            End If

            lbl_Mensagem.text = vog_Conexao.ExecSQl(vsl_Sql)
            If instr(1,lbl_Mensagem.text,"ORA-00001") > 0 then
                lbl_Mensagem.text = "Informação duplicada"
            End if
            lbl_UPLOAD_ARQ.text = "Enviada com sucesso"
        catch Exp as exception

                lbl_UPLOAD_ARQ.text = "Erro no envio."

        End Try
        pc_monta_dtg_Img()
        MyBase.Page_Load(Sender,E)
    End Sub



Wagner Oliveira





Similar Threads
Thread Thread Starter Forum Replies Last Post
EM missing server in the list blackadder_ba2 SQL Server 2000 1 January 17th, 2006 04:36 AM
EM catplus SQL Server 2000 4 December 27th, 2004 09:12 AM
Problem constructing view using EM in SQL server 2 roniestein SQL Server 2000 8 November 25th, 2003 01:48 PM
EM Question ioates SQL Server 2000 1 November 19th, 2003 07:37 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.