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

error en la variable en Persits.Jpeg??

Estas en el tema de error en la variable en Persits.Jpeg?? en el foro de ASP Clásico en Foros del Web. hola, tengo el siguiente codigo asp en donde tomo en variable el nombre del archivo para modificar el tamaó y resulta que no encuentra la ...
  #1 (permalink)  
Antiguo 05/01/2011, 13:50
Avatar de JJF
JJF
 
Fecha de Ingreso: mayo-2005
Mensajes: 205
Antigüedad: 19 años
Puntos: 0
error en la variable en Persits.Jpeg??

hola, tengo el siguiente codigo asp en donde tomo en variable el nombre del archivo para modificar el tamaó y resulta que no encuentra la ruta del mismo, siendo que el archivo está en su carpeta.

Código:
Aquó las variables:

response.write("Juasno")

response.write""&foto1&""

response.write"carpeta de destino " & uploadsDirVar & ""

ESTAS 3 VARIABLES SE IMPRIMEN (existen)
el tema es que no la PUEDO TOMAR PARA FORMAR LA RUTA:


line 163 . ' Se crea el objeto
line 164 . Set Jpeg = Server.CreateObject("Persits.Jpeg")
line 165 . ' Se carga la imagen a transformar
line 166 . Jpeg.Open Server.MapPath(".\imgbig\"&foto1&"")
Si donde dice Jpeg.Open Server.MapPath(".\imgbig\ pongo la variable tampoco llega a destino.

Para mí está bien, pero me dice que no encuentra el archivo.

aqui lo que me muestra:

carpeta de destino \\hmfsw\web\dtcwin160\tatata.com\public_html\imgbi g

nombre de imagen: 3071837bandera_argentina.jpg

Persits.Jpeg.1 error '800a0002'

The system cannot find the file specified.

/uploadTestermio.asp, line 166


Alguien podrá decirme cómo sería la forma para mostrarle al sistema la ruta correcta? gracias.

Última edición por JJF; 05/01/2011 a las 13:52 Razón: mejorar la expresion.
  #2 (permalink)  
Antiguo 05/01/2011, 15:15
Avatar de Myakire
Colaborador
 
Fecha de Ingreso: enero-2002
Ubicación: Centro de la república
Mensajes: 8.849
Antigüedad: 22 años, 3 meses
Puntos: 146
Respuesta: error en la variable en Persits.Jpeg??

Yo necesitaría ver el resultado de imprimir Server.MapPath(".\imgbig\"&foto1), no la variable uploadsDirVar que no utilizas.

La ruta física que te muestre es la que debes asegurarte que sea la correcta
  #3 (permalink)  
Antiguo 05/01/2011, 18:53
Avatar de JJF
JJF
 
Fecha de Ingreso: mayo-2005
Mensajes: 205
Antigüedad: 19 años
Puntos: 0
Respuesta: error en la variable en Persits.Jpeg??

El mismo error...

Persits.Jpeg.1 error '800a0002'

The system cannot find the file specified.

/uploadTestermio.asp, line 166
  #4 (permalink)  
Antiguo 06/01/2011, 04:44
Avatar de JJF
JJF
 
Fecha de Ingreso: mayo-2005
Mensajes: 205
Antigüedad: 19 años
Puntos: 0
Respuesta: error en la variable en Persits.Jpeg??

aqui el code completito
Código:
<%@ Language=VBScript %>
<% 

option explicit 
Response.Expires = -1
Server.ScriptTimeout = 600
' All communication must be in UTF-8, including the response back from the request
Session.CodePage  = 65001
%>
<!-- #include file="freeaspupload.asp" -->
<%


  ' ****************************************************
  ' Change the value of the variable below to the pathname
  ' of a directory with write permissions, for example "C:\Inetpub\wwwroot"
  ' ****************************************************

  Dim uploadsDirVar
  uploadsDirVar = Server.MapPath("imgbig/")    

  ' Note: this file uploadTester.asp is just an example to demonstrate
  ' the capabilities of the freeASPUpload.asp class. There are no plans
  ' to add any new features to uploadTester.asp itself. Feel free to add
  ' your own code. If you are building a content management system, you
  ' may also want to consider this script: http://www.webfilebrowser.com/

function OutputForm()
%>
    <form name="frmSend" method="POST" enctype="multipart/form-data" accept-charset="utf-8" action="uploadTestermio.asp" onSubmit="return onSubmitForm();">
	<B>File names:</B><br>
    File 1: <input name="attach1" type="file" size=35><br>
    File 2: <input name="attach2" type="file" size=35><br>
    File 3: <input name="attach3" type="file" size=35><br>
    File 4: <input name="attach4" type="file" size=35><br>
    <br> 
	<!-- These input elements are obviously optional and just included here for demonstration purposes -->
	<br>
	<!-- End of additional elements -->
    <input style="margin-top:4" type=submit value="Upload">
    </form>
<%
end function


function TestEnvironment()
    Dim fso, fileName, testFile, streamTest
    TestEnvironment = ""
    Set fso = Server.CreateObject("Scripting.FileSystemObject")
    if not fso.FolderExists(uploadsDirVar) then
        TestEnvironment = "<B>Folder " & uploadsDirVar & " does not exist.</B><br>The value of your uploadsDirVar is incorrect. Open uploadTester.asp in an editor and change the value of uploadsDirVar to the pathname of a directory with write permissions."
        exit function
    end if
    fileName = uploadsDirVar & "\test.txt"
    on error resume next
    Set testFile = fso.CreateTextFile(fileName, true)
    If Err.Number<>0 then
        TestEnvironment = "<B>Folder " & uploadsDirVar & " does not have write permissions.</B><br>The value of your uploadsDirVar is incorrect. Open uploadTester.asp in an editor and change the value of uploadsDirVar to the pathname of a directory with write permissions."
        exit function
    end if
    Err.Clear
    testFile.Close
    fso.DeleteFile(fileName)
    If Err.Number<>0 then
        TestEnvironment = "<B>Folder " & uploadsDirVar & " does not have delete permissions</B>, although it does have write permissions.<br>Change the permissions for IUSR_<I>computername</I> on this folder."
        exit function
    end if
    Err.Clear
    Set streamTest = Server.CreateObject("ADODB.Stream")
    If Err.Number<>0 then
        TestEnvironment = "<B>The ADODB object <I>Stream</I> is not available in your server.</B><br>Check the Requirements page for information about upgrading your ADODB libraries."
        exit function
    end if
    Set streamTest = Nothing
end function

dim temporal
function SaveFiles
    Dim Upload, fileName, fileSize, ks, i, fileKey

    Set Upload = New FreeASPUpload
    Upload.Save(uploadsDirVar)

	' If something fails inside the script, but the exception is handled
	If Err.Number<>0 then Exit function

    SaveFiles = ""
    ks = Upload.UploadedFiles.keys
    if (UBound(ks) <> -1) then
        SaveFiles = "<B>Files uploaded:</B> "
        for each fileKey in Upload.UploadedFiles.keys
            SaveFiles = SaveFiles & Upload.UploadedFiles(fileKey).FileName & " (" & Upload.UploadedFiles(fileKey).Length & "B) "
            
' genero el nombre de la variable de la imagen

session("foto1")=Upload.UploadedFiles(fileKey).FileName 


            
 ' Se crea el objeto
Set Jpeg = Server.CreateObject("Persits.Jpeg")
' Se carga la imagen a transformar


Jpeg.Open Server.MapPath("./imgbig/"&Session("foto1"))


' Nuevo largo
L = 100

' Se indican los nuevos valores
Jpeg.Width = L
Jpeg.Height = Jpeg.OriginalHeight * L / Jpeg.OriginalWidth

'Se guarda la nueva imagen
Jpeg.Save Server.MapPath("imgmini/"&foto1)


    next
    else
        SaveFiles = "No file selected for upload or the file name specified in the upload form does not correspond to a valid file in the system."
    end if
ok, hasta aquí llegué, ahora el error:

Persits.Jpeg.1 error '800a0002'

The system cannot find the file specified.

/uploadTestermio.asp, line 105



La línea 105 es la siguiente:
Jpeg.Open Server.MapPath("./imgbig/"&Session("foto1"))
  #5 (permalink)  
Antiguo 06/01/2011, 13:29
Avatar de Myakire
Colaborador
 
Fecha de Ingreso: enero-2002
Ubicación: Centro de la república
Mensajes: 8.849
Antigüedad: 22 años, 3 meses
Puntos: 146
Respuesta: error en la variable en Persits.Jpeg??

Y qué te regresa un:

response.write Server.MapPath("./imgbig/"&Session("foto1"))
response.end

??
  #6 (permalink)  
Antiguo 06/01/2011, 18:34
Avatar de JJF
JJF
 
Fecha de Ingreso: mayo-2005
Mensajes: 205
Antigüedad: 19 años
Puntos: 0
Respuesta: error en la variable en Persits.Jpeg??

Hola Myakire, gracias por atenderme, la sentencia me devuelve lo siguiente:


\\hmfsw\web\dtcwin160\tatata.com\public_html\imgbi g\855094DSCI0823 (Large).JPG


La imagen sube normalmente, pero al llamarla no viene! es desobediente.

Etiquetas: variables
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 06:49.