Foros del Web » Programando para Internet » ASP Clásico »

Problema al subir archivo al servidor!!!????

Estas en el tema de Problema al subir archivo al servidor!!!???? en el foro de ASP Clásico en Foros del Web. Tengo que subir archivos de imagenes al servidor, como no tengo a mi disponibilidad el ASPupload estoy subiendo los archivos mediante filesystemobject y bueno entonces ...
  #1 (permalink)  
Antiguo 05/12/2005, 15:34
Avatar de @padawan@  
Fecha de Ingreso: julio-2005
Mensajes: 393
Antigüedad: 18 años, 11 meses
Puntos: 6
Problema al subir archivo al servidor!!!????

Tengo que subir archivos de imagenes al servidor, como no tengo a mi disponibilidad el ASPupload estoy subiendo los archivos mediante filesystemobject y bueno entonces cuando quiero ejecutar el script me tira un error de Permission Denied, y yo le di permisos a todas las carpetas y me estoy volviendo loco, tengo que configurar algo mas? algo del IIS?? cualquier ayuda agradesco.
  #2 (permalink)  
Antiguo 05/12/2005, 16:05
Avatar de u_goldman
Moderador
 
Fecha de Ingreso: enero-2002
Mensajes: 8.031
Antigüedad: 22 años, 5 meses
Puntos: 98
Pero necesitas de un componente o algun script para "recoger" los archivos del formulario que no?

Busca en este foro sobre el xelupload.

Salu2,
__________________
"El hombre que ha empezado a vivir seriamente por dentro, empieza a vivir más sencillamente por fuera."
-- Ernest Hemingway
  #3 (permalink)  
Antiguo 05/12/2005, 16:33
 
Fecha de Ingreso: abril-2004
Ubicación: México D.F.
Mensajes: 1.724
Antigüedad: 20 años, 1 mes
Puntos: 4
Tiene razón el master lo que te dice, me entra la curiosidad de como le estás haciendo. Podrías poner tu código ?
  #4 (permalink)  
Antiguo 06/12/2005, 06:33
Avatar de @padawan@  
Fecha de Ingreso: julio-2005
Mensajes: 393
Antigüedad: 18 años, 11 meses
Puntos: 6
si si lo hago con esa clase gratuito el xeupload.asp

Codigo

Código PHP:
dim objUpload

set objUpload 
= new xelUpload
objUpload
.Upload()

set objFich objUpload.Ficheros("file")

objFich.Guardar "e:\inetpub\wwwroot\carpeta" 
y me tira el siguiente error

Permission Denied

la lineaa que tira el error es cuando quiere crear un archivo en el servidor con el filesystemobject. me parece que es un problema de configuracion del servidor pero no se que , si alguien tiene una idea .....
  #5 (permalink)  
Antiguo 06/12/2005, 08:17
Avatar de tomchat  
Fecha de Ingreso: septiembre-2005
Mensajes: 231
Antigüedad: 18 años, 9 meses
Puntos: 0
Aqui te dejo este codigo muy bueno:

<%@LANGUAGE="VBSCRIPT"%>
<HTML>
<HEAD>
<TITLE>SAVEANY</TITLE>
<LINK REL="StyleSheet" MEDIA="screen" TYPE="text/css" HREF="estilo.css">
</HEAD>
<Body topmargin="0" leftmargin=0>
<%Func = Request("Func")
if isempty(Func) Then
Func = 1
End if
Select Case Func
Case 1
%>

<table width="505" border="1" align="center" class="textocelda" bgcolor="#ffffff" bordercolor="006699" style="BORDER-COLLAPSE: collapse">
<tr>
<td width="762" BGCOLOR="336699">
<b><font size="3" color="#ffffff">Selecciona una Archivo para subir. </font></b>
</td>
</tr>
<tr>
<td width="762">

<FORM ENCTYPE="multipart/form-data" ACTION="saveany.asp?func=2" METHOD=POST id=form1 name=form1>

<TABLE height="192" bgcolor="#ffffff" width="498">
<TR>
<TD height="1" width="492"></TD>
</TR>
<TR>
<TD height="18" class="textocelda" width="492"><font color="#000000">Pulsa en el botón examinar y elige el archivo de tu ordenador.</font></TD>
</TR>
<TR>
<TD class="textocelda" height="36" width="492"><font color="#000000">Luego pulsa el botón subir.</font></TD>
</TR>
<TR>
<TD class="textocelda" height="18" width="492"><b>Nombre del archivo...</b></font></STRONG></TD>
</TR>
<TR>
<TD height="31" class="textocelda" width="492">
<INPUT NAME=File1 SIZE=50 TYPE=file CLASS="DATOS">
</TD>
</TR>
<TR>
<TD align=left height="40" width="492">
<INPUT type="submit" value="Subir" class="boton">
</TD>
</TR>
<TR>
<TD height="20" class="textocelda" width="492"><font color="#000000">NOTA: Espera, recibirás una notificación cuando el archivo haya sido subido.</font></TD>
</TR>
</TABLE>

</form>
</td>
</tr>
</table>

<%
Case 2
ForWriting = 2
adLongVarChar = 201
lngNumberUploaded = 0

'Get binary data from form
noBytes = Request.TotalBytes
binData = Request.BinaryRead (noBytes)
'convery the binary data to a string
Set RST = CreateObject("ADODB.Recordset")
LenBinary = LenB(binData)

if LenBinary > 0 Then
RST.Fields.Append "myBinary", adLongVarChar, LenBinary
RST.Open
RST.AddNew
RST("myBinary").AppendChunk BinData
RST.Update
strDataWhole = RST("myBinary")
End if

'Creates a raw data file for with all da
' ta sent. Uncomment for debuging.
'Set fso = CreateObject("Scripting.FileSystemObject")
'Set f = fso.OpenTextFile(server.mappath(".") & "\raw.txt", ForWriting, True)
'f.Write strDataWhole
'set f = nothing
'set fso = nothing
'get the boundry indicator

strBoundry = Request.ServerVariables ("HTTP_CONTENT_TYPE")
lngBoundryPos = instr(1,strBoundry,"boundary=") + 8
strBoundry = "--" & right(strBoundry,len(strBoundry)-lngBoundryPos)

'Get first file boundry positions.

lngCurrentBegin = instr(1,strDataWhole,strBoundry)
lngCurrentEnd = instr(lngCurrentBegin + 1,strDataWhole,strBoundry) - 1

Do While lngCurrentEnd > 0
'Get the data between current boundry an
' d remove it from the whole.
strData = mid(strDataWhole,lngCurrentBegin, lngCurrentEnd - lngCurrentBegin)
strDataWhole = replace(strDataWhole,strData,"")

'Get the full path of the current file.
lngBeginFileName = instr(1,strdata,"filename=") + 10
lngEndFileName = instr(lngBeginFileName,strData,chr(34))
'Make sure they selected at least one fi
' le.
if lngBeginFileName = lngEndFileName and lngNumberUploaded = 0 Then

Response.Write "<H2> Ha ocurrido el siguiente error.</H2>"
Response.Write "Debes elegir un archivo para subir"
Response.Write "<BR><BR>Pulsa el botón volver, realiza la corrección."
Response.Write "<BR><BR><INPUT type='button' onclick='history.go(-1)' value='<< Volver' id='button'1 name='button'> "
Response.End
End if
'There could be one or more empty file b
' oxes.
if lngBeginFileName <> lngEndFileName Then
strFilename = mid(strData,lngBeginFileName,lngEndFileName - lngBeginFileName)
'Creates a raw data file with data betwe
' en current boundrys. Uncomment for debug
' ing.
'Set fso = CreateObject("Scripting.FileSystemObject")
'Set f = fso.OpenTextFile(server.mappath(".") & "\raw_" & lngNumberUploaded & ".txt", ForWriting, True)
'f.Write strData
'set f = nothing
'set fso = nothing

'Loose the path information and keep jus
' t the file name.
tmpLng = instr(1,strFilename,"\")
Do While tmpLng > 0
PrevPos = tmpLng
tmpLng = instr(PrevPos + 1,strFilename,"\")
Loop

FileName = right(strFilename,len(strFileName) - PrevPos)

NomArchivo = request.querystring("FileName")

'Get the begining position of the file d
' ata sent.
'if the file type is registered with the
' browser then there will be a Content-Typ
' e
lngCT = instr(1,strData,"Content-Type:")

if lngCT > 0 Then
lngBeginPos = instr(lngCT,strData,chr(13) & chr(10)) + 4
Else
lngBeginPos = lngEndFileName
End if
'Get the ending position of the file dat
' a sent.
lngEndPos = len(strData)

'Calculate the file size.
lngDataLenth = lngEndPos - lngBeginPos
'Get the file data
strFileData = mid(strData,lngBeginPos,lngDataLenth)
'Create the file.
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile(server.mappath("..") & "\administrador\archivos_administrador\docuemntos_ informacion\informacion_general\" &_
FileName, ForWriting, True)
f.Write strFileData
Set f = nothing
Set fso = nothing

lngNumberUploaded = lngNumberUploaded + 1

End if

'Get then next boundry postitions if any
' .
lngCurrentBegin = instr(1,strDataWhole,strBoundry)
lngCurrentEnd = instr(lngCurrentBegin + 1,strDataWhole,strBoundry) - 1
loop


Response.Write "Archivo subido"
Response.Write lngNumberUploaded & " archivo ya está en el servidor.<BR>"
Response.Write "<BR><BR><INPUT type='button' onclick='document.location=" & chr(34) & "saveany.asp" & chr(34) & "' value='<< Volver' id='button'1 name='button'1 class='boton'>"
End Select
Response.write (NomArchivo)%>

</BODY></HTML>
  #6 (permalink)  
Antiguo 06/12/2005, 08:38
Avatar de reel  
Fecha de Ingreso: febrero-2004
Ubicación: Managua, Nicaragua
Mensajes: 496
Antigüedad: 20 años, 4 meses
Puntos: 1
Además de los permisos de la carpeta con windows (osea en el filesystem), en el IIS debes poner el permiso de escritura tambíen a dicha carpeta, busca la pestaña Directorio desde la propiedades de la carpeta pero por medio del IIS.

Saludes
__________________
Leer es Saber, REEL.
Mi Blog
  #7 (permalink)  
Antiguo 06/12/2005, 08:48
Avatar de @padawan@  
Fecha de Ingreso: julio-2005
Mensajes: 393
Antigüedad: 18 años, 11 meses
Puntos: 6
no existe algo menos complejo para subir un simple archivo??
  #8 (permalink)  
Antiguo 06/12/2005, 10:23
Avatar de u_goldman
Moderador
 
Fecha de Ingreso: enero-2002
Mensajes: 8.031
Antigüedad: 22 años, 5 meses
Puntos: 98
Menos complejo que asignar permisos??
Pues no, no creo...lo menos complejo seria no hacerlo, ja ja ja
Es muy sencillo, nada mas haz click derecho----propiedades----seguridad----y ve que el usuario que usa el IIS tenga permisos de escritura sobre esa carpeta.

Salu2,
__________________
"El hombre que ha empezado a vivir seriamente por dentro, empieza a vivir más sencillamente por fuera."
-- Ernest Hemingway
  #9 (permalink)  
Antiguo 06/12/2005, 11:45
Avatar de @padawan@  
Fecha de Ingreso: julio-2005
Mensajes: 393
Antigüedad: 18 años, 11 meses
Puntos: 6
No, no , estoy haciendo pruebas con lo que vos me dijiste , lo de menos complicado estaba dirigido al que puso el codigo extenso. cuando termine las pruebas te digo como me fue, gracias por la ayuda.

Cita:
Iniciado por u_goldman
Menos complejo que asignar permisos??
Pues no, no creo...lo menos complejo seria no hacerlo, ja ja ja
Es muy sencillo, nada mas haz click derecho----propiedades----seguridad----y ve que el usuario que usa el IIS tenga permisos de escritura sobre esa carpeta.

Salu2,
  #10 (permalink)  
Antiguo 06/12/2005, 13:23
Avatar de @padawan@  
Fecha de Ingreso: julio-2005
Mensajes: 393
Antigüedad: 18 años, 11 meses
Puntos: 6
Me tira el mismo error ya le di permisos a todo pero me sigue tirando el mismo error , reinicie el IIS por las dudas por si no tomaba los cambios pero nada,
tendre que reiniciar el servidor entero '??
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 00:27.