Visualizzazione dei risultati da 1 a 2 su 2

Discussione: upload Lento

  1. #1

    upload Lento

    Ciao a tutti...

    ho un problema con qusta funzione di Upload, la quale mi consente di uplodare velocemente fal eda 200 KB in giu ...

    il problema è legato alla funzione di conversione...

    esiste un modo per migliorare la funzione ?

    GRAZIE CIAO


    codice:
    
    <%
    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("Uploads") & "\"
    Set oFSO = Server.CreateObject("Scripting.FileSystemObject")
    oFSO.OpenTextFile(sPath & sFileName, nForWriting, True).Write sNewData
    Set oFSO = Nothing
    
    Set oFile = Nothing
    Set oUpload = Nothing
    %>
    File has been saved in file system.  View this file:
    
    
    Uploads\<%=sFileName%>
    codice:
    ' 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

  2. #2
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    Se sei in hosting potresti chiedere se puoi utilizzare componenti installati sul server.

    Roby

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.