Foros del Web » Programando para Internet » PHP »

problema de permisos?

Estas en el tema de problema de permisos? en el foro de PHP en Foros del Web. lo que pasa es que tengo una pag php y de un botón genero un PO-UP en el cual, adjunto una foto, la redimenziono a ...
  #1 (permalink)  
Antiguo 13/09/2010, 12:41
Avatar de xamilo  
Fecha de Ingreso: febrero-2010
Mensajes: 120
Antigüedad: 14 años, 2 meses
Puntos: 1
problema de permisos?

lo que pasa es que tengo una pag php y de un botón
genero un PO-UP en el cual, adjunto una foto, la redimenziono a thumbs y luego muestro es imaagen redimencionada

es punto es al momento de mostrar la imagen no me muestra nada
y me dice "Warning: opendir()" y "Warning: readdir()"

eso es problema de permisos?? como lo arreglo??
__________________
- Ingeniero en Informática -
  #2 (permalink)  
Antiguo 13/09/2010, 12:44
Avatar de xalupeao  
Fecha de Ingreso: mayo-2008
Ubicación: Santiago, Chile
Mensajes: 749
Antigüedad: 15 años, 11 meses
Puntos: 12
Respuesta: problema de permisos?

te sale solo eso ? :S nada mas ... pon el error completo.
__________________
Hosting en Chile en Silverhost - La solución en Hosting en Chile.
  #3 (permalink)  
Antiguo 13/09/2010, 12:46
Avatar de xamilo  
Fecha de Ingreso: febrero-2010
Mensajes: 120
Antigüedad: 14 años, 2 meses
Puntos: 1
Respuesta: problema de permisos?

Warning: opendir(../thumbs) [function.opendir]: failed to open dir: No error in C:\xampp\htdocs\xxx\xxx\carga_informe.php on line 132

Warning: readdir(): supplied argument is not a valid Directory resource in C:\xampp\htdocs\xxx\xxx\carga_informe.php on line 133

me redimenciona las imagenes en la karpeta pero no me las muestra
__________________
- Ingeniero en Informática -
  #4 (permalink)  
Antiguo 13/09/2010, 16:44
Avatar de rickyper  
Fecha de Ingreso: abril-2009
Mensajes: 182
Antigüedad: 15 años
Puntos: 10
Respuesta: problema de permisos?

Puedes poner tu codigo para chequearlo?
  #5 (permalink)  
Antiguo 14/09/2010, 07:51
Avatar de xamilo  
Fecha de Ingreso: febrero-2010
Mensajes: 120
Antigüedad: 14 años, 2 meses
Puntos: 1
Respuesta: problema de permisos?

Código PHP:
Ver original
  1. <?php
  2.  
  3. $directorio_ruta="../"; // Actualizar ruta de directorio
  4. include ($directorio_ruta.'include/comunes.php');
  5.  
  6. ?>
  7.  <html>
  8. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  9. <html xmlns="http://www.w3.org/1999/xhtml">
  10. <head>
  11. <title>:: INERCOM ::</title>
  12. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  13. <link href="<? echo $directorio_ruta; ?>css/tmkestilos.css" rel="stylesheet" type="text/css">
  14. <link href="<? echo $directorio_ruta; ?>css/estilosMENU.css" rel="stylesheet" type="text/css">
  15. <script type="text/javascript" src="<? echo $directorio_ruta; ?>include/jquery.js"></script>
  16. <script type="text/javascript" src="<? echo $directorio_ruta; ?>include/ddaccordion.js"></script>
  17. <script type="text/javascript" src="<? echo $directorio_ruta; ?>include/configmenu.js"></script>
  18. <?
  19. if (is_uploaded_file($_FILES['imagen']['tmp_name']))
  20. {
  21.     $max = 200; //anchura o altura que no queres que se pase
  22.     $pic = $_FILES['imagen']['tmp_name']; //o lo que te llega por HTTP
  23.     $datos = getimagesize($pic);
  24.     if($datos[2]==1){$im = @imagecreatefromgif($pic);}
  25.     if($datos[2]==2){$im = @imagecreatefromjpeg($pic);}
  26.     if($datos[2]==3){$im = @imagecreatefrompng($pic);}
  27.  
  28.     $x = imagesx($im);
  29.     $y = imagesy($im);
  30.     if (($x > $max) || ($y > $max) )
  31.     {
  32.         if($x >= $y){
  33.             $nx = $max;
  34.             $ny = $max * $y/$x;
  35.         }else{
  36.             $ny = $max;
  37.             $nx = $max * $x/$y;
  38.         }
  39.         $img = imagecreatetruecolor($nx,$ny);
  40.     }
  41.     else
  42.     {
  43.         $img = imagecreatetruecolor($x,$y);
  44.     }
  45.     //transparente
  46.    
  47.     if ( ($datos[2]==1) || ($datos[2]==3) )
  48.     {
  49.    
  50.           $trnprt_indx = imagecolortransparent($im);
  51.           if ($trnprt_indx >= 0) {
  52.             $trnprt_color    = imagecolorsforindex($im, $trnprt_indx);
  53.             $trnprt_indx    = imagecolorallocate($img, $trnprt_color['red'], $trnprt_color['green'], $trnprt_color['blue']);
  54.             imagefill($img, 0, 0, $trnprt_indx);
  55.             imagecolortransparent($img, $trnprt_indx);
  56.           }            
  57.           elseif ($datos[2]==3) {
  58.             imagealphablending($img, false);
  59.             $color = imagecolorallocatealpha($img, 0, 0, 0, 127);
  60.             imagefill($img, 0, 0, $color);
  61.             imagesavealpha($img, true);
  62.           }
  63.     }
  64.     //fin transparente
  65.     if (($x > $max) || ($y > $max) )
  66.     {
  67.         imagecopyresampled($img,$im,0,0,0,0,$nx,$ny,$x,$y) ;
  68.     }
  69.     else
  70.     {
  71.         imagecopyresampled($img,$im,0,0,0,0,$x,$y,$x,$y) ;
  72.     }
  73.     if($datos[2]==1){imagegif($img,"thumbs/".$_FILES['imagen']['name']);}
  74.     if($datos[2]==2){imagejpeg($img,"thumbs/".$_FILES['imagen']['name'],75);} //el 75 es la calidad de la imagen
  75.     if($datos[2]==3){imagepng($img,"thumbs/".$_FILES['imagen']['name']);}  
  76.     imagedestroy($img);
  77.     }
  78. ?>
  79.  
  80.  
  81.  
  82. <script>
  83. function validar()
  84. {
  85.     if(document.getElementById('archivo').value == '')
  86.     {
  87.         alert("Debe seleccionar un archivo");
  88.         return false;
  89.     }
  90. }
  91. </script>
  92. </head>
  93. <body leftmargin="0" topmargin="0">
  94. <table style="height:100%;width:100%;" border="0" cellpadding="0" cellspacing="0">
  95.     <tr>
  96.         <td valign="top">
  97.         </td>
  98.     </tr>
  99.     <tr>
  100.         <td valign="top">
  101.         </td>
  102.     </tr>
  103.     <td><img src="http://www.forosdelweb.com/f18/images/logo_informe.jpg" height='100' width='100%' border='0'></td>
  104.             <? echo encabezado_html_doble($vartitulo,$directorio_ruta); ?>
  105.             <table cellpadding="0" cellspacing="0" border="0" width="300" align="center" class="letra">
  106.                 <tr>
  107.                     <td align="center" class="titulosmenuprincipales">Crear Informe</td>
  108.                 </tr>
  109.             </table>
  110.  
  111.     <form id="insertar" enctype="multipart/form-data" name="insertar" method="post" action="" onSubmit="return validar(this)">
  112.     <table>
  113.         <tr><td><strong>Subir de imagenes</strong></td></tr>
  114.         <tr>
  115.             <td>
  116.             <input type="file" name="imagen">
  117.             <input type="hidden" name="enviado" value="1">
  118.              <tr><td align="center"><input type="submit" value="Enviar"></td></tr>
  119.             </td>
  120.         </tr>
  121.     </table>
  122.     </form>
  123.     <? echo pie_html_reporte($directorio_ruta); ?>
  124.  
  125. <? if($_REQUEST['enviado'] == 1)
  126. {
  127.     echo encabezado_html_doble($vartitulo,$directorio_ruta); ?>
  128.   <form name="mostrar" ><table align="center"><tr><td align="center"><strong>Imagenes</strong></td></tr><tr><td>            
  129.   <?
  130.     $dir=opendir("../thumbs");
  131.     while ($file=readdir($dir))
  132.     {
  133.         echo $pic;
  134.         $auxiliar = explode(".", $file);
  135.         //echo $auxiliar;
  136.        
  137.         if($auxiliar[1] == "jpg") {
  138.         echo "<img src='thumbs/$file'><br>"; ?>
  139.         <textarea name="obs" cols="80" rows="4" class="letra"></textarea> <br/> <? }
  140.         if($auxiliar[1] == "png") {
  141.         echo "<img src='thumbs/$file'><br>";?>
  142.         <textarea name="obs" cols="80" rows="4" class="letra"></textarea><br/><? }
  143.         if($auxiliar[1] == "gif") {
  144.         echo "<img src='thumbs/$file'><br>"; ?>
  145.         <textarea name="obs" cols="80" rows="4" class="letra"></textarea> <br/><? }
  146.          ?><tr><td align="left"><input type="submit" value="Enviar"></td></tr> <?
  147.     }
  148. }
  149.      echo pie_html_reporte($directorio_ruta); ?>
  150.       </td></tr> </table></form>
  151.      
  152.    
  153.     <tr>    
  154.         <td>
  155.             <? /**
  156.             * PIE DE PAGINA BRAINWINNER
  157.             */ ?>
  158.             <? include ($directorio_ruta.'include/pie_brain.php');?>
  159.         </td>
  160.     </tr>
  161. </table>    
  162. </body>
  163. </html>

en el comunes.php llamos a echo pie_html_reporte($directorio_ruta); y el otro que son lineas
__________________
- Ingeniero en Informática -
  #6 (permalink)  
Antiguo 14/09/2010, 08:51
Avatar de rickyper  
Fecha de Ingreso: abril-2009
Mensajes: 182
Antigüedad: 15 años
Puntos: 10
Respuesta: problema de permisos?

Veo tu código y me parace que todo esta bien, mas parecen problemas de permisos prueba a dar todos los permisos 777 a las carpetas que usaras.
  #7 (permalink)  
Antiguo 14/09/2010, 09:21
Avatar de xamilo  
Fecha de Ingreso: febrero-2010
Mensajes: 120
Antigüedad: 14 años, 2 meses
Puntos: 1
Respuesta: problema de permisos?

y desde windows ??? komo ??? le hago???
__________________
- Ingeniero en Informática -
  #8 (permalink)  
Antiguo 14/09/2010, 09:31
Avatar de rickyper  
Fecha de Ingreso: abril-2009
Mensajes: 182
Antigüedad: 15 años
Puntos: 10
Respuesta: problema de permisos?

Aqui hay algo:

http://www.forosdelweb.com/f59/no-logro-dar-permisos-escritura-249083/
http://www.trucoswindows.net/tutorial-48-TUTORIAL-Como-cambiar-o-quitar-permisos-para-archivos-y-carpetas.html
  #9 (permalink)  
Antiguo 14/09/2010, 10:15
Avatar de xamilo  
Fecha de Ingreso: febrero-2010
Mensajes: 120
Antigüedad: 14 años, 2 meses
Puntos: 1
Respuesta: problema de permisos?

dicho y hecho
muchas gracias, ya lo arregle =)
__________________
- Ingeniero en Informática -

Etiquetas: permisos
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 23:20.