Ir para conteúdo

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Legionario-rs

Separar nomes dos arquivos

Recommended Posts

Boa tarde pessoal,

Tenho o seguinte trecho do cód.

<%response.buffer=true
Server.ScriptTimeout = 99999999%>
<%
Set Upload = Server.CreateObject("Persits.Upload.1")
Upload.IgnoreNoPost = True
Upload.Save "xxx"

For Each File in Upload.Files
Response.Write "<input type=text size=10 id=upimg_01 value="&File.Filename&">"
Next

%>

Nele eu consigo visualizar nome por nome dos arquivos enviados mas dispostos da seguinte forma: "imagem1.jpg, imagem2.jpg... assim por diante até a imagem 15 pois o upload feito tem 15 imagens no total. Eu preciso que sejam mostrados os nomes das imagens separados pois preciso atribuir uma "id" para cada nome de imagem que será repassado para um novo formulário que ai realiza o cadastro. Só preciso separar o nome de cada imagem em uma input diferente mas não consigo. Se alguém puder ajudar agradeço.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Armazena os calores em uma array. Tipo:

 

Dim array_imagem()

Dim i

For Each File in Upload.Files

i = i + 1

array_imagem(i) = File.Filename
Response.Write "<input type=text size=10 id=upimg_01 value="&File.Filename&">"
Next

 

ve se funciona

Compartilhar este post


Link para o post
Compartilhar em outros sites

olha este exemplo:

Public function GetFilename(ByVal strGetPath)
    Dim nPos, strFilename
    Dim strDir
    strFilename = ""
        strGetPath = cstr(strGetPath)
        if Not len(strGetPath) = 0 Then
            nPos = InStrRev(strGetPath, "\", Len(strGetPath))
            if nPos > 0 Then
                strFilename = Right(strGetPath, Len(strGetPath) - nPos)
                'Response.Write strFilename
            End if
            nPos = InstrRev(strGetPath, "\", Len(strGetPath) - nPos)
            if nPos > 0 Then
                strDir = Right(strGetPath, Len(strGetPath) - nPos)
            Else
                strDir = ""
            End if 
        End if
        GetFilename = strFilename
    End function

Compartilhar este post


Link para o post
Compartilhar em outros sites

olha esta função

Public function GetFilename(ByVal strGetPath)
    Dim nPos, strFilename
    Dim strDir
    strFilename = ""
        strGetPath = cstr(strGetPath)
        if Not len(strGetPath) = 0 Then
            nPos = InStrRev(strGetPath, "\", Len(strGetPath))
            if nPos > 0 Then
                strFilename = Right(strGetPath, Len(strGetPath) - nPos)
                'Response.Write strFilename
            End if
            nPos = InstrRev(strGetPath, "\", Len(strGetPath) - nPos)
            if nPos > 0 Then
                strDir = Right(strGetPath, Len(strGetPath) - nPos)
            Else
                strDir = ""
            End if 
        End if
        GetFilename = strFilename
    End function

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.