Visualizzazione dei risultati da 1 a 2 su 2

Discussione: upload file pdf

  1. #1

    upload file pdf

    Ciao a tutti

    ho il seguente script attraverso il quale faccio uplodare agli utenti dei file pdf
    e anche word (pltre a informazioni testuali):

    codice:
    <?  if ($email != "") { } else { 	die("E-mail field empty."); }  if ($superdat_name != "") { copy("$superdat", "/www/test/test/miosito.it/httpdocs/test/abstract/files/$superdat_name") or  die("Couldn't copy file."); }  if ($superdat2_name != "") { copy("$superdat2", "/www/test/vhosts/miosito.it/test/test/abstract/files/$superdat2_name") or  die("Couldn't copy file.");  } else { 	die("No input file specified."); }  mail("info@miosito.it", "TEST-Abstract",  "Title of abstract - $titleabstract  Author1 - $author1  Author2 - $author2  Author3 - $author3  Author4 - $author4  Author5 - $author5  Author6 - $author6  Author7 - $author7  Author8 - $author8  Author9 - $author9  Author10 - $author10  CorrespondingAuthorAffiliation - $correspondingauthor  Affiliation2 - $affiliation2  Affiliation3 - $affiliation3  Affiliation4 - $affiliation4  Affiliation5 - $affiliation5  Affiliation6 - $affiliation6  Affiliation7 - $affiliation7  Affiliation8 - $affiliation8  Affiliation9 - $affiliation9  Affiliation10 - $affiliation10  CorrespondingAuthorEmail - $email  ContributionToSession - $radiobutton  PosterOral - $radiobutton2  Prova - $email sent $superdat_name, a $superdat_size byte file with a MIME type of $superdat_type  Prova - $email sent $superdat2_name, a $superdat2_size byte file with a MIME type of $superdat2_type");  ?>    <html> <head>         <title>TEST</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css">  </style> <body bgcolor=white text=black link=blue>   <p align=center></p> <p align=center>Congratulations! Your information have been successfully submitted. <? echo "$superdat_name"; ?>, a <? echo "$superdat_size"; ?> byte file with a mime type of <? echo "$superdat_type"; ?>.</p> <p align=center>Congratulations! Your information have been successfully submitted. <? echo "$superdat2_name"; ?>, a <? echo "$superdat2_size"; ?> byte file with a mime type of <? echo "$superdat2_type"; ?>.</p> <? $to = $email; $cc = ""; $subject = "Confirmation"; $message = "Dear Sirs\n\r"; $message .= "$nome$cognome
    \r\n"; $message .= "this is to confirm that we received your Abstract correctly \r\n"; $from = "info@miosito.it"; $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "Content-Transfer-Encoding: 7bit\r\n"; $headers .= "From: " . $from . "\r\n"; $headers .= "CC: " .$cc . "\r\n"; $invio_conferma = mail($to, $subject, $message, $headers); if ($invio_conferma) {     echo("<p align=center>An e-mail confirmation has been sent to the following address:$email</p>"); }else{     echo("Contattare WebMaster"); } ?>  </body> </html>
    Quando provo ad uplodare il file pdf pigiando il pulsante INVIA mi da il seguente messaggio di errore:

    Warning: copy(): open_basedir restriction in effect. File(/www/test/test/miosito.it/test/miosito.it/abstract/files/18_test.pdf) is not within the allowed path(s): (/test/test/test/miosito.it/test:/tmp) in /www/test/test/miosito.it/test/test/abstract/do_upload.php on line 9

    Warning: copy(/www/test/test/miosito.it/test/test/abstract/files/18_test.pdf): failed to open stream: Operation not permitted in /www/test/test/miosito.it/test/test/abstract/do_upload.php on line 9
    Couldn't copy file.

    Mi aiutate a capire dove sta l'errore? dove sbaglio?

    Grazie anticipatamente per ogni aiuto

  2. #2
    hai la direttiva open_basedir attiva che non ti permette di scrivere al di fuori di alcuni percorsi specificati.

    Puoi disattivarla oppure aggiungere i percorsi che ti servono nel php.ini

    http://php.net/manual/en/features.safe-mode.php
    « Se nella prima mezz'ora non capisci chi è il pollo, allora il pollo sei tu. » [Thomas "Amarillo Slim" Preston, campione del mondo di poker]

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.