Visualizzazione dei risultati da 1 a 4 su 4
  1. #1

    Passaggio valori campi di tipo FILE

    Ciao a tutti. Ho provato a vedere se ci sono post precedenti per questo problema ma non ho trovato.

    Ho queste pagine ASP :

    La prima oltre ad un normale campo input text ha anche 2 campi di tipo File per gli allegati

    <form action="displayCampi.asp" method="post">
    Data:<input type="text" id="TxtData" name="TxtData" size="8" maxlength="10" value="">

    Allegato1:<input type="file" id="File1" name="File1" size="55">

    Allegato2:<input type="file" id="File2" name="File2" size="55">

    <input id="conf1" Name="conf1" Value="Conferma" Type=Submit>

    </form>


    nella pagina displayCampi.asp vado a visualizzare i campi :
    <%
    data = Request.Form("TxtData")
    response.write "Data " & data & "
    "
    For Each File In Form.Files.Items
    response.write "FILE:" & file & "
    "
    Next
    %>

    Però l'istruzione For Each File In Form.Files.Items va in errore
    dicendo : Errore di run-time di Microsoft VBScript (0x800A01A8)
    Necessario oggetto: ''


    Dove sbaglio ??

    Grazie

  2. #2
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    Quando usi i campi file, questi non puoi recuperarli con request.form
    Fai una ricerca nel forum per UPLAOD.

    Roby

  3. #3
    Utente di HTML.it L'avatar di vic53
    Registrato dal
    Oct 2010
    residenza
    Fonte Nuova (Roma)
    Messaggi
    592

    Re: Passaggio valori campi di tipo FILE

    Originariamente inviato da euro58_88
    Ciao a tutti. Ho provato a vedere se ci sono post precedenti per questo problema ma non ho trovato.

    Ho queste pagine ASP :

    La prima oltre ad un normale campo input text ha anche 2 campi di tipo File per gli allegati

    <form action="displayCampi.asp" method="post">
    Data:<input type="text" id="TxtData" name="TxtData" size="8" maxlength="10" value="">

    Allegato1:<input type="file" id="File1" name="File1" size="55">

    Allegato2:<input type="file" id="File2" name="File2" size="55">

    <input id="conf1" Name="conf1" Value="Conferma" Type=Submit>

    </form>


    nella pagina displayCampi.asp vado a visualizzare i campi :
    <%
    data = Request.Form("TxtData")
    response.write "Data " & data & "
    "
    For Each File In Form.Files.Items
    response.write "FILE:" & file & "
    "
    Next
    %>

    Però l'istruzione For Each File In Form.Files.Items va in errore
    dicendo : Errore di run-time di Microsoft VBScript (0x800A01A8)
    Necessario oggetto: ''


    Dove sbaglio ??

    Grazie
    ciao... credo che sbagli completamente l'approccio al tipo di oggetto....
    il campo file riferisce a un oggetto del tuo PC... non del server dove vuoi far girare il form....
    i nomi dei file dal tuo Pc li puoi prelevare con l'istruzione type="file" con una dialog-box ma l'invio lo devi effettuare con una routine dal tipo form particolare associato a uno script....vedi gli esempi di uload file sui server...con una dichiarativa di uso di una class upload....per esempio e un form
    Dimenticavo...La send mail con allegati la effettua il server non il tuo client PC e quindi gli allegati devono transitare nelle cartelle del server web e da li spediti con le routine di invio mail...
    Spero di essere stato chiaro ma comunque devi studiare di piu la cosa perche non è cosi semplice come la vuoi fare tu...

    ciao
    vic53


    --------- ti do un esempio di un pezzo di sito che trasferisce un file libri dal client al server....---

    ...

    <%

    Dim oUpload

    Dim oFile

    Dim sFileName

    Dim oFSO

    Dim sPath

    Dim sNewData

    Dim nLength

    Dim bytBinaryData





    Const nForReading = 1

    Const nForWriting = 2

    Const nForAppending = 8



    ' grab the uploaded file data

    Set oUpload = New clsUpload

    Set oFile = oUpload("File1")



    ' parse the file name

    sFileName = oFile.FileName

    If Not InStr(sFileName, "\") = 0 Then

    sFileName = Mid(sFileName, InStrRev(sFileName, "\") + 1)

    End If



    ' Convert the binary data to Ascii

    bytBinaryData = oFile.BinaryData

    nLength = LenB(bytBinaryData)

    For nIndex = 1 To nLength

    sNewData = sNewData & Chr(AscB(MidB(bytBinaryData, nIndex, 1)))

    Next



    ' Save the file to the file system

    sPath = Server.MapPath("public/images/libri") & "/"

    Set oFSO = Server.CreateObject("Scripting.FileSystemObject")

    oFSO.OpenTextFile(sPath & sFileName, nForWriting, True).Write sNewData

    Set oFSO = Nothing



    Set oFile = Nothing

    Set oUpload = Nothing

    %>

    Il file <%=sFileName%> è stato salvato nella cartella del server...



    Torna al pannello di controllo



    ---------------------------------

    il file che manca è "upload.class" per trasmettere....lo inserisco sotto e lo devi salvare col nome sopra... cosi lo puoi studiare...ma non modificare altrimenti non funge
    ---------------------------------------------------------------------------------------------------------------------------------
    <%

    ' ------------------------------------------------------------------------------

    ' Container of Field Properties

    Class clsField

    Public FileName

    Public ContentType

    Public Value

    Public FieldName

    Public Length

    Public BinaryData

    End Class

    ' ------------------------------------------------------------------------------

    Class clsUpload

    ' ------------------------------------------------------------------------------

    Private nFieldCount

    Private oFields()



    ' ------------------------------------------------------------------------------

    Public Property Get Count()

    Count = nFieldCount

    End Property

    ' ------------------------------------------------------------------------------

    Public Default Property Get Field(ByRef asFieldName)

    Dim lnLength

    Dim lnIndex



    lnLength = UBound(oFields)



    If IsNumeric(asFieldName) Then

    If lnLength >= asFieldName And asFieldName > -1 Then

    Set Field = oFields(asFieldName)

    Else

    Set Field = New clsField

    End If

    Else

    For lnIndex = 0 To lnLength

    If LCase(oFields(lnIndex).FieldName) = LCase(asFieldName) Then

    Set Field = oFields(lnIndex)

    Exit Property

    End If

    Next

    Set Field = New clsField

    End If

    End Property

    ' ------------------------------------------------------------------------------

    Public Function Exists(ByRef avKeyIndex)

    Exists = Not IndexOf(avKeyIndex) = -1

    End Function

    ' ------------------------------------------------------------------------------

    Public Property Get ValueOf(ByRef avKeyIndex)

    Dim lnIndex

    lnIndex = IndexOf(avKeyIndex)

    if lnIndex = -1 Then Exit Property

    ValueOf = oFields(lnIndex).Value

    End Property

    ' ------------------------------------------------------------------------------

    Public Property Get FileNameOf(ByRef avKeyIndex)

    Dim lnIndex

    lnIndex = IndexOf(avKeyIndex)

    if lnIndex = -1 Then Exit Property

    FileNameOf = oFields(lnIndex).FileName

    End Property

    ' ------------------------------------------------------------------------------

    Public Property Get LengthOf(ByRef avKeyIndex)

    Dim lnIndex

    lnIndex = IndexOf(avKeyIndex)

    if lnIndex = -1 Then Exit Property

    LengthOf = oFields(lnIndex).LengthOf

    End Property

    ' ------------------------------------------------------------------------------

    Public Property Get BinaryDataOf(ByRef avKeyIndex)

    Dim lnIndex

    lnIndex = IndexOf(avKeyIndex)

    if lnIndex = -1 Then Exit Property

    BinaryDataOf = oFields(lnIndex).BinaryData

    End Property

    ' ------------------------------------------------------------------------------

    Private Function IndexOf(ByVal avKeyIndex)

    Dim lnIndex

    If IsNumeric(asFieldName) Then

    avKeyIndex = CLng(avKeyIndex)

    If nFieldCount > avKeyIndex And avKeyIndex > -1 Then

    IndexOf = avKeyIndex

    Else

    IndexOf = -1

    End If

    Else

    For lnIndex = 0 To nFieldCount - 1

    If LCase(oFields(lnIndex).FieldName) = LCase(avKeyIndex) Then

    IndexOf = lnIndex

    Exit Function

    End If

    Next

    IndexOf = -1

    End If

    End Function

    ' ------------------------------------------------------------------------------

    Public Property Get ContentTypeOf(ByRef avKeyIndex)

    Dim lnIndex

    lnIndex = IndexOf(avKeyIndex)

    if lnIndex = -1 Then Exit Property

    ContentTypeOf = oFields(lnIndex).ContentType

    End Property

    ' ------------------------------------------------------------------------------

    Private Sub Class_Terminate()

    For lnIndex = 0 To nFieldCount - 1

    Set oFields(0) = Nothing

    Next

    End Sub

    ' ------------------------------------------------------------------------------

    Private Sub Class_Initialize()



    Dim lnBytes ' Bytes received from the client

    Dim lnByteCount ' Number of bytes received

    Dim lnStartPosition ' Position at which content begins

    Dim lnEndPosition ' Position at which content ends



    Dim loDic ' Contains properties of each

    ' specific field

    ' Local dictionary object(s)

    ' to be appended to class-scope

    ' dictioary object.



    Dim lnBoundaryBytes ' Bytes contained within the current boundary

    Dim lnBoundaryStart ' Position at wich the current boundary begins

    ' within the lnBytes binary data.

    Dim lnBoundaryEnd ' Position at wich the current boundary ends

    ' within the lnBytes binary data.

    Dim lnDispositionPosition



    Dim lsFieldName ' Name of the current field being parsed from

    ' Binary Data

    Dim lsFileName ' Name of the file within the current boundary

    Dim lnFileNamePosition ' Location of file name within current boundary



    ' Initialize Fields

    nFieldCount = 0

    ReDim oFields(-1)



    ' Read the bytes (binary data) into memory

    lnByteCount = Request.TotalBytes

    lnBytes = Request.BinaryRead(lnByteCount)



    'Get the lnBoundaryBytes

    lnStartPosition = 1

    lnEndPosition = InstrB(lnStartPosition, lnBytes, CStrB(vbCr))



    lnBoundaryBytes = MidB(lnBytes, lnStartPosition, lnEndPosition - lnStartPosition)



    lnBoundaryStart = InstrB(1, lnBytes, lnBoundaryBytes)





    ' Loop until the BoundaryBytes begin with "--"

    Do Until (lnBoundaryStart = InstrB(lnBytes, lnBoundaryBytes & CStrB("--")))



    ' All data within this boundary is stored within a local dictionary

    ' to be appended to the class-scope dictionary.



    ReDim Preserve oFields(nFieldCount)

    nFieldCount = nFieldCount + 1



    Set loField = New clsField



    lnDispositionPosition = InstrB(lnBoundaryStart, lnBytes, CStrB("Content-Disposition"))



    ' Get an object name

    lnStartPosition = InstrB(lnDispositionPosition, lnBytes, CStrB("name=")) + 6

    lnEndPosition = InstrB(lnStartPosition, lnBytes, CStrB(""""))

    lsFieldName = CStrU(MidB(lnBytes, lnStartPosition, lnEndPosition - lnStartPosition))

    loField.FieldName = lsFieldName



    ' Get the location fo the file name.

    lnFileNamePosition = InstrB(lnBoundaryStart, lnBytes, CStrB("filename="))

    lnBoundaryEnd = InstrB(lnEndPosition, lnBytes, lnBoundaryBytes)



    'Test if object is a file

    If Not lnFileNamePosition = 0 And lnFileNamePosition < lnBoundaryEnd Then



    ' Parse Filename

    lnStartPosition = lnFileNamePosition + 10

    lnEndPosition = InstrB(lnStartPosition, lnBytes, CStrB(""""))

    lsFileName = CStrU(MidB(lnBytes,lnStartPosition,lnEndPosition-lnStartPosition))

    loField.FileName = lsFileName



    ' Parse Content-Type

    lnStartPosition = InstrB(lnEndPosition,lnBytes,CStrB("Content-Type:")) + 14

    lnEndPosition = InstrB(lnStartPosition,lnBytes,CStrB(vbCr))

    ContentType = CStrU(MidB(lnBytes,lnStartPosition,lnEndPosition-lnStartPosition))

    loField.ContentType = ContentType



    ' Parse Content

    lnStartPosition = lnEndPosition + 4

    lnEndPosition = InstrB(lnStartPosition,lnBytes,lnBoundaryBytes)-2

    Value = MidB(lnBytes,lnStartPosition,lnEndPosition-lnStartPosition)

    loField.BinaryData = Value & CStrB(vbNull)

    loField.Length = LenB(Value)

    Else



    ' Parse Content

    lnStartPosition = InstrB(lnDispositionPosition, lnBytes, CStrB(vbCr)) + 4

    lnEndPosition = InstrB(lnStartPosition, lnBytes, lnBoundaryBytes) - 2

    Value = CStrU(MidB(lnBytes,lnStartPosition,lnEndPosition-lnStartPosition))

    loField.Value = Value

    loField.Length = Len(Value)

    End If



    Set oFields(UBound(oFields)) = loField



    'Loop to next object

    lnBoundaryStart = InstrB(lnBoundaryStart + LenB(lnBoundaryBytes), lnBytes, lnBoundaryBytes)



    Set loField = Nothing



    Loop



    End Sub

    ' ------------------------------------------------------------------------------

    Private Function CStrU(ByRef psByteString)

    Dim lnLength

    Dim lnPosition

    lnLength = LenB(psByteString)

    For lnPosition = 1 To lnLength

    CStrU = CStrU & Chr(AscB(MidB(psByteString, lnPosition, 1)))

    Next

    End Function

    ' ------------------------------------------------------------------------------

    Private Function CStrB(ByRef psUnicodeString)

    Dim lnLength

    Dim lnPosition

    lnLength = Len(psUnicodeString)

    For lnPosition = 1 To lnLength

    CStrB = CStrB & ChrB(AscB(Mid(psUnicodeString, lnPosition, 1)))

    Next

    End Function

    ' ------------------------------------------------------------------------------

    End Class

    ' ------------------------------------------------------------------------------

    %>
    Vic53

  4. #4
    Utente di HTML.it L'avatar di vic53
    Registrato dal
    Oct 2010
    residenza
    Fonte Nuova (Roma)
    Messaggi
    592

    Re: Re: Passaggio valori campi di tipo FILE

    Originariamente inviato da vic53
    ciao... credo che sbagli completamente l'approccio al tipo di oggetto....
    il campo file riferisce a un oggetto del tuo PC... non del server dove vuoi far girare il form....
    i nomi dei file dal tuo Pc li puoi prelevare con l'istruzione type="file" con una dialog-box ma l'invio lo devi effettuare con una routine dal tipo form particolare associato a uno script....vedi gli esempi di uload file sui server...con una dichiarativa di uso di una class upload....per esempio e un form
    Dimenticavo...La send mail con allegati la effettua il server non il tuo client PC e quindi gli allegati devono transitare nelle cartelle del server web e da li spediti con le routine di invio mail...
    Spero di essere stato chiaro ma comunque devi studiare di piu la cosa perche non è cosi semplice come la vuoi fare tu...

    ciao
    vic53


    --------- ti do un esempio di un pezzo di sito che trasferisce un file libri dal client al server....---

    ...

    <%

    Dim oUpload

    Dim oFile

    Dim sFileName

    Dim oFSO

    Dim sPath

    Dim sNewData

    Dim nLength

    Dim bytBinaryData





    Const nForReading = 1

    Const nForWriting = 2

    Const nForAppending = 8



    ' grab the uploaded file data

    Set oUpload = New clsUpload

    Set oFile = oUpload("File1")



    ' parse the file name

    sFileName = oFile.FileName

    If Not InStr(sFileName, "\") = 0 Then

    sFileName = Mid(sFileName, InStrRev(sFileName, "\") + 1)

    End If



    ' Convert the binary data to Ascii

    bytBinaryData = oFile.BinaryData

    nLength = LenB(bytBinaryData)

    For nIndex = 1 To nLength

    sNewData = sNewData & Chr(AscB(MidB(bytBinaryData, nIndex, 1)))

    Next



    ' Save the file to the file system

    sPath = Server.MapPath("public/images/libri") & "/"

    Set oFSO = Server.CreateObject("Scripting.FileSystemObject")

    oFSO.OpenTextFile(sPath & sFileName, nForWriting, True).Write sNewData

    Set oFSO = Nothing



    Set oFile = Nothing

    Set oUpload = Nothing

    %>

    Il file <%=sFileName%> è stato salvato nella cartella del server...



    Torna al pannello di controllo



    ---------------------------------

    il file che manca è "upload.class" per trasmettere....lo inserisco sotto e lo devi salvare col nome sopra... cosi lo puoi studiare...ma non modificare altrimenti non funge
    ---------------------------------------------------------------------------------------------------------------------------------
    <%

    ' ------------------------------------------------------------------------------

    ' Container of Field Properties

    Class clsField

    Public FileName

    Public ContentType

    Public Value

    Public FieldName

    Public Length

    Public BinaryData

    End Class

    ' ------------------------------------------------------------------------------

    Class clsUpload

    ' ------------------------------------------------------------------------------

    Private nFieldCount

    Private oFields()



    ' ------------------------------------------------------------------------------

    Public Property Get Count()

    Count = nFieldCount

    End Property

    ' ------------------------------------------------------------------------------

    Public Default Property Get Field(ByRef asFieldName)

    Dim lnLength

    Dim lnIndex



    lnLength = UBound(oFields)



    If IsNumeric(asFieldName) Then

    If lnLength >= asFieldName And asFieldName > -1 Then

    Set Field = oFields(asFieldName)

    Else

    Set Field = New clsField

    End If

    Else

    For lnIndex = 0 To lnLength

    If LCase(oFields(lnIndex).FieldName) = LCase(asFieldName) Then

    Set Field = oFields(lnIndex)

    Exit Property

    End If

    Next

    Set Field = New clsField

    End If

    End Property

    ' ------------------------------------------------------------------------------

    Public Function Exists(ByRef avKeyIndex)

    Exists = Not IndexOf(avKeyIndex) = -1

    End Function

    ' ------------------------------------------------------------------------------

    Public Property Get ValueOf(ByRef avKeyIndex)

    Dim lnIndex

    lnIndex = IndexOf(avKeyIndex)

    if lnIndex = -1 Then Exit Property

    ValueOf = oFields(lnIndex).Value

    End Property

    ' ------------------------------------------------------------------------------

    Public Property Get FileNameOf(ByRef avKeyIndex)

    Dim lnIndex

    lnIndex = IndexOf(avKeyIndex)

    if lnIndex = -1 Then Exit Property

    FileNameOf = oFields(lnIndex).FileName

    End Property

    ' ------------------------------------------------------------------------------

    Public Property Get LengthOf(ByRef avKeyIndex)

    Dim lnIndex

    lnIndex = IndexOf(avKeyIndex)

    if lnIndex = -1 Then Exit Property

    LengthOf = oFields(lnIndex).LengthOf

    End Property

    ' ------------------------------------------------------------------------------

    Public Property Get BinaryDataOf(ByRef avKeyIndex)

    Dim lnIndex

    lnIndex = IndexOf(avKeyIndex)

    if lnIndex = -1 Then Exit Property

    BinaryDataOf = oFields(lnIndex).BinaryData

    End Property

    ' ------------------------------------------------------------------------------

    Private Function IndexOf(ByVal avKeyIndex)

    Dim lnIndex

    If IsNumeric(asFieldName) Then

    avKeyIndex = CLng(avKeyIndex)

    If nFieldCount > avKeyIndex And avKeyIndex > -1 Then

    IndexOf = avKeyIndex

    Else

    IndexOf = -1

    End If

    Else

    For lnIndex = 0 To nFieldCount - 1

    If LCase(oFields(lnIndex).FieldName) = LCase(avKeyIndex) Then

    IndexOf = lnIndex

    Exit Function

    End If

    Next

    IndexOf = -1

    End If

    End Function

    ' ------------------------------------------------------------------------------

    Public Property Get ContentTypeOf(ByRef avKeyIndex)

    Dim lnIndex

    lnIndex = IndexOf(avKeyIndex)

    if lnIndex = -1 Then Exit Property

    ContentTypeOf = oFields(lnIndex).ContentType

    End Property

    ' ------------------------------------------------------------------------------

    Private Sub Class_Terminate()

    For lnIndex = 0 To nFieldCount - 1

    Set oFields(0) = Nothing

    Next

    End Sub

    ' ------------------------------------------------------------------------------

    Private Sub Class_Initialize()



    Dim lnBytes ' Bytes received from the client

    Dim lnByteCount ' Number of bytes received

    Dim lnStartPosition ' Position at which content begins

    Dim lnEndPosition ' Position at which content ends



    Dim loDic ' Contains properties of each

    ' specific field

    ' Local dictionary object(s)

    ' to be appended to class-scope

    ' dictioary object.



    Dim lnBoundaryBytes ' Bytes contained within the current boundary

    Dim lnBoundaryStart ' Position at wich the current boundary begins

    ' within the lnBytes binary data.

    Dim lnBoundaryEnd ' Position at wich the current boundary ends

    ' within the lnBytes binary data.

    Dim lnDispositionPosition



    Dim lsFieldName ' Name of the current field being parsed from

    ' Binary Data

    Dim lsFileName ' Name of the file within the current boundary

    Dim lnFileNamePosition ' Location of file name within current boundary



    ' Initialize Fields

    nFieldCount = 0

    ReDim oFields(-1)



    ' Read the bytes (binary data) into memory

    lnByteCount = Request.TotalBytes

    lnBytes = Request.BinaryRead(lnByteCount)



    'Get the lnBoundaryBytes

    lnStartPosition = 1

    lnEndPosition = InstrB(lnStartPosition, lnBytes, CStrB(vbCr))



    lnBoundaryBytes = MidB(lnBytes, lnStartPosition, lnEndPosition - lnStartPosition)



    lnBoundaryStart = InstrB(1, lnBytes, lnBoundaryBytes)





    ' Loop until the BoundaryBytes begin with "--"

    Do Until (lnBoundaryStart = InstrB(lnBytes, lnBoundaryBytes & CStrB("--")))



    ' All data within this boundary is stored within a local dictionary

    ' to be appended to the class-scope dictionary.



    ReDim Preserve oFields(nFieldCount)

    nFieldCount = nFieldCount + 1



    Set loField = New clsField



    lnDispositionPosition = InstrB(lnBoundaryStart, lnBytes, CStrB("Content-Disposition"))



    ' Get an object name

    lnStartPosition = InstrB(lnDispositionPosition, lnBytes, CStrB("name=")) + 6

    lnEndPosition = InstrB(lnStartPosition, lnBytes, CStrB(""""))

    lsFieldName = CStrU(MidB(lnBytes, lnStartPosition, lnEndPosition - lnStartPosition))

    loField.FieldName = lsFieldName



    ' Get the location fo the file name.

    lnFileNamePosition = InstrB(lnBoundaryStart, lnBytes, CStrB("filename="))

    lnBoundaryEnd = InstrB(lnEndPosition, lnBytes, lnBoundaryBytes)



    'Test if object is a file

    If Not lnFileNamePosition = 0 And lnFileNamePosition < lnBoundaryEnd Then



    ' Parse Filename

    lnStartPosition = lnFileNamePosition + 10

    lnEndPosition = InstrB(lnStartPosition, lnBytes, CStrB(""""))

    lsFileName = CStrU(MidB(lnBytes,lnStartPosition,lnEndPosition-lnStartPosition))

    loField.FileName = lsFileName



    ' Parse Content-Type

    lnStartPosition = InstrB(lnEndPosition,lnBytes,CStrB("Content-Type:")) + 14

    lnEndPosition = InstrB(lnStartPosition,lnBytes,CStrB(vbCr))

    ContentType = CStrU(MidB(lnBytes,lnStartPosition,lnEndPosition-lnStartPosition))

    loField.ContentType = ContentType



    ' Parse Content

    lnStartPosition = lnEndPosition + 4

    lnEndPosition = InstrB(lnStartPosition,lnBytes,lnBoundaryBytes)-2

    Value = MidB(lnBytes,lnStartPosition,lnEndPosition-lnStartPosition)

    loField.BinaryData = Value & CStrB(vbNull)

    loField.Length = LenB(Value)

    Else



    ' Parse Content

    lnStartPosition = InstrB(lnDispositionPosition, lnBytes, CStrB(vbCr)) + 4

    lnEndPosition = InstrB(lnStartPosition, lnBytes, lnBoundaryBytes) - 2

    Value = CStrU(MidB(lnBytes,lnStartPosition,lnEndPosition-lnStartPosition))

    loField.Value = Value

    loField.Length = Len(Value)

    End If



    Set oFields(UBound(oFields)) = loField



    'Loop to next object

    lnBoundaryStart = InstrB(lnBoundaryStart + LenB(lnBoundaryBytes), lnBytes, lnBoundaryBytes)



    Set loField = Nothing



    Loop



    End Sub

    ' ------------------------------------------------------------------------------

    Private Function CStrU(ByRef psByteString)

    Dim lnLength

    Dim lnPosition

    lnLength = LenB(psByteString)

    For lnPosition = 1 To lnLength

    CStrU = CStrU & Chr(AscB(MidB(psByteString, lnPosition, 1)))

    Next

    End Function

    ' ------------------------------------------------------------------------------

    Private Function CStrB(ByRef psUnicodeString)

    Dim lnLength

    Dim lnPosition

    lnLength = Len(psUnicodeString)

    For lnPosition = 1 To lnLength

    CStrB = CStrB & ChrB(AscB(Mid(psUnicodeString, lnPosition, 1)))

    Next

    End Function

    ' ------------------------------------------------------------------------------

    End Class

    ' ------------------------------------------------------------------------------

    %>
    -----------------------------

    il form che utilizza il campo tipo file è circa così dove la routin chiamata per spedire il file si chiama "saveupload.asp" per esempio

    <form method="POST" enctype="multipart/form-data" action="saveupload.asp">

    <div align="center">






    <span class="Stile8">Modulo di trasmissione del file immagine (.jpg) sulla cartella [public/images/libri</span><font size="2">/]</font><font size="2">


    </font><span class="Stile1">File del PC:</span>

    <input type="file" name="file1" size="40">







    <input type="submit" name="Enter" value="Upload -->">

    </p>
    ......
    </form>

    ari ciao
    Vic53
    Vic53

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.