ASP - UPLOAD SIN COMPONENTES (para el que le interese)

 
Vista:

UPLOAD SIN COMPONENTES (para el que le interese)

Publicado por fer (270 intervenciones) el 23/08/2001 13:23:19
Excelente articulo de MIquel van Otegem de alliance para el que quiera comprender el funcionamiento de clases en ASP y como se suben ficheros al servidor.

uploadscript1.asp
<%
Option Explicit

Dim oUpload

'Create object, note the New statement instead of Server.CreateObject
Set oUpload = New FileUpload

'Read and set MIME type and then send file back to browser
Response.ContentType = oUpload.ContentType("UploadFile")
Response.BinaryWrite oUpload.Value("UploadFile")

Set oUpload = Nothing
%>
<!--#include file="clsFileUpload.asp"-->

You can also request the values in the form and save the file.

uploadscript2.asp
<%
Option Explicit

Dim oUpload
Dim oFSO, oFile
Dim lngPathEnd
Dim strPath, strFile
Dim i

'Create object, note the New statement instead of Server.CreateObject
Set oUpload = New FileUpload

'Get path and filename
lngPathEnd = Len(Server.MapPath(Request.ServerVariables("PATH_INFO"))) - 14
strPath = Left(Server.Mappath(Request.ServerVariables("PATH_INFO")), lngPathEnd)
strFile = "uploaded" & oUpload.FileName("UploadFile")

'Create file and write data into it
Set oFSO = Server.CreateObject("Scripting.FileSystemObject")
Set oFile = oFSO.CreateTextFile(strPath & strFile)
For i = 1 To LenB(oUpload.Value("UploadFile"))
oFile.Write Chr(AscB(MidB(oUpload.Value("UploadFile"), i, 1)))
Next

'Close file and release objects
oFile.Close
Set oFile = Nothing
Set oFSO = Nothing

Response.Write "Thank yo
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

RE:UPLOAD SIN COMPONENTES (para el que le interese

Publicado por luisbeto (20 intervenciones) el 24/08/2001 22:31:25
A primera vista hace falta por lo menos la etiqueta de cierre %>

ahi te encargo lo demas primo!!, si es posible pases el url del articulo

Gracias
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

RE:UPLOAD SIN COMPONENTES (para el que le interese

Publicado por fer (270 intervenciones) el 27/08/2001 13:31:37
no se cargo ni la mitad del articulo.

La direccion del articulo es: http://www.aspalliance.com/Michiel/uploadscript.asp
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