
02/11/2009, 11:00
|
 | | | Fecha de Ingreso: noviembre-2009
Mensajes: 4
Antigüedad: 15 años, 6 meses Puntos: 0 | |
Respuesta: error en el upload hola yo yengo un problema con el Set Upload = Server.CreateObject("Persits.Upload.")
mi pagina funcionaba excelente hasta hace unos dias que no permite hacer upload
el codigo es
<%
Dim Upload, mensaje, valor Set Upload = Server.CreateObject("Persits.Upload")//Aqui es donde me marca el error pero en otro apartado de mi pagina si puedo si funciona no me marca error en Set Upload = Server.CreateObject("Persits.Upload")
' Enable UTF-8 translation
Upload.CodePage = 65001
' Limit file size to 5 x 1024 x 1024 = 5242880 bytes, throw an exception if file is larger
Upload.SetMaxSize 5242880, True 'Le he puesto maximo 5 megas
' Intercept all exceptions to display user-friendly error
On Error Resume Next
pathEnd = Len(Server.mappath(Request.ServerVariables("PATH_I NFO")))-2
path = server.MapPath("add2.asp")
path1 = left(path,InStr(path,"\add2.asp"))
uploadsDirVar = path1 & "images\"
'Guardo el fichero en la ruta correspondiente
Upload.Save(uploadsDirVar)
' 8 is the number of "File too large" exception
mensaje=""
valor=0
If Err.Number = 8 Then
valor=1
Else
If Err <> 0 Then
mensaje=t_(129) & Err.Description
Else
'Recojo el nombre del fichero que se ha subido
Set File= Upload.Files("foto")
If Not File Is Nothing Then
foto = file.Filename
extension = split(foto,".")
if extension(1) <> "gif" then
'REDIMENSIONAMOS LA IMAGEN
Set jpeg = Server.CreateObject("Persits.Jpeg")
jpeg.Open( File.Path )
if jpeg.OriginalWidth>=jpeg.OriginalHeight then 'HORIZONTAL
if jpeg.OriginalWidth>70 then
jpeg.Width=70
jpeg.Height=jpeg.OriginalHeight * 70 / jpeg.OriginalWidth
end if
else 'VERTICAL
if jpeg.OriginalHeight>70 then
jpeg.Height=70
jpeg.Width=jpeg.OriginalWidth * 70 / jpeg.OriginalHeight
end if
end if
jpeg.Canvas.Brush.Color = &H626467
x=0
y=0
if jpeg.Width<70 then
x=(70-jpeg.Width)/2
end if
if jpeg.Height<70 then
y=(70-jpeg.Height)/2
end if
jpeg.Crop -1*x, -1*y, jpeg.Width + x, jpeg.Height + y
Jpeg.Save uploadsDirVar&foto
end if
end if
End If
End If
If (IsDate(Upload.Form("Date_Month") + "/" + Upload.Form("Date_Day") + "/" + Upload.Form("Date_Year")) and servidor=0) or (IsDate(Upload.Form("Date_Day") + "/" + Upload.Form("Date_Month") + "/" + Upload.Form("Date_Year")) and servidor=1) Then
Set RSEVENTS = Server.CreateObject("ADODB.Recordset")
RSEVENTS.Open "Events", Conn, 2, 2
RSEVENTS.addnew
RSEVENTS("Event_Name") = Upload.Form("Event_Name")
RSEVENTS("Description") = Upload.Form("txtContent")
RSEVENTS("Category") = Upload.Form("Category")
RSEVENTS("formato") = Upload.Form("formato")
RSEVENTS("id_idioma")=session("idioma_calendar" & prj)
if servidor=0 then
eventDate = Upload.Form("Date_Month") + "/" + Upload.Form("Date_Day") + "/" + Upload.Form("Date_Year") + " " + Upload.Form("Time_Hour") + ":" + Upload.Form("Time_Minute") + ":00 " + Upload.Form("Time_AMPM")
else
eventDate = Upload.Form("Date_Day") + "/" + Upload.Form("Date_Month") + "/" + Upload.Form("Date_Year") + " " + Upload.Form("Time_Hour") + ":" + Upload.Form("Time_Minute") + ":00 " + Upload.Form("Time_AMPM")
end if
RSEVENTS("Date") = eventDate
If (Upload.Form("Location") = "") Then
RSEVENTS("Location") = ""
Else
RSEVENTS("Location") = Upload.Form("Location")
End If
RSEVENTS("registration") = Upload.Form("registration")
if foto<>"" then
RSEVENTS("foto") = foto
end if
RSEVENTS.update
RSEVENTS.close
set RSEVENTS = nothing
End If
%>
que podria esta pasando porque si es que no estubiera regireada esa clase no podria subir ni editar en mi otra seccion
el error que me aparece es: Server object error 'ASP 0177 : 800401f3'
Server.CreateObject Failed
/eventcalendar/admin/edit2.asp, line 17
800401f3
y la linea es Set Upload = Server.CreateObject("Persits.Upload"
gracias de antemano |