Visualizzazione dei risultati da 1 a 7 su 7

Discussione: Problemi Upload

  1. #1

    Problemi Upload

    Ciao a tutti,
    premetto che se di ASP ci sto iniziando a capire qualcosa, di Php ancora buio totale... comunque mi ritrovo a "combattere" con un upload in php il quale fino a 10 Mb invia oltre invece da conferma che è tutto ok ma invece non invia nulla.
    Ho verificato con la funzione phpinfo(); il limite upload_max_filesize che è 50M.
    Di seguito posto il codice completo, se qualche anima buona potesse aiutarmi..Thanks!

    <? $dont_redirect = 1;
    if (file_exists("../_home/_authenticate.php")) include("../_home/_authenticate.php");
    include("../_home/_functions.php"); ?>
    <html><head><title><?=$l000685?></title>
    <? include("../_home/_style.php"); ?>
    </head>
    <body bgcolor="<?=$_SESSION['color5']?>" topmargin="7" marginheight="7" onload="this.focus()">
    <table width="100%" cellspacing="0" cellpadding="0" border="0">
    <tr>
    <td width="32" rowspan="2">[img]<?=$_SESSION['site_url_site']?>/_admin/_images/_icons/_32/_mult_upload.gif[/img]</td>
    <td rowspan="2" width="12">
    </td>
    <td>
    <div style="color:<?=$_SESSION['color1']?>;font-size:12pt;font-style:normal;font-weight:bold;font-family:arial"><?=$l000685?></div>
    </td>
    </tr>
    <tr><td><hr width="100%" size="1" color="<?=$_SESSION['color4'];?>" noshade></td></tr>
    </table>
    <? include("_files_inc/_misc.inc.php");
    if ($_POST['upload'] == 1) { if ($_SESSION['super_user'] != 1 && $_SESSION['s13'] != 1) { $result = mysql_query ("SELECT access_sub,allow_space FROM ".$_SESSION['dbase_prefix']."users WHERE user_id_admin='".$_SESSION['s8']."'");
    $row = mysql_fetch_array($result);
    $access_sub = $row["access_sub"];
    $allow_space = $row["allow_space"];
    $result = mysql_query ("SELECT folder FROM ".$_SESSION['dbase_prefix']."users_folders WHERE user_id_admin='".$_SESSION['s8']."'");
    if ($row = mysql_fetch_array($result)) { do { $dir = $_SESSION['s11'] . $row["folder"];
    if ($access_sub == 1) $size2 = getSize($dir,1);
    else $size2 = getSize($dir,0); $size = $size + $size2; }
    while($row = mysql_fetch_array($result)); } }
    $conn = @ftp_connect($_SESSION['s3'], $_SESSION['ftp_port']);
    if ($conn !== false) { if (@ftp_login($conn, $_SESSION['s4'], $_SESSION['s5'])) {
    if ($_SESSION['s6'] == "false") ftp_pasv($conn, false);
    else ftp_pasv($conn, true);
    $i = 0; while($i < 10) { $i++; $file = $_FILES['upload'.$i];
    if ($file['tmp_name'] != "") { $file_size = f39($file['size']);
    if ($_SESSION['super_user'] == 1) { $_f18 = "../_cache/".$file['name'];
    move_uploaded_file($file['tmp_name'],$_f18); $destination_file = $_SESSION['cwd'] . "/" . $file['name'];
    @ftp_put($conn, $destination_file, $_f18, FTP_BINARY);
    unlink($_f18); $success .= "[*]".$file['name']." ($file_size)\n"; }
    else { $file_ok = 0; $path_parts = pathinfo($file['name']);
    $ext = $path_parts['extension'];
    $ext = strtolower($ext);
    if( is_array($_SESSION['allowed_file_types']) && count($array)<1) { if (in_array($ext, $_SESSION['allowed_file_types'])) { $file_ok = 1; }
    else { $file_ext .= "[*]".$file['name']." ($file_size)"; $file_ok = 0; } }
    else { $file_ok = 1; }
    if ($file_ok == 1) { if ($_SESSION['max_upload_size'] != "") { if ($file['size'] > $_SESSION['max_upload_size']) { $file_max .= "[*]".$file['name']." ($file_size)"; $file_ok = 0; } } }
    if ($file_ok == 1 && $_SESSION['s13'] != 1) { if ($allow_space != "") { $size = $size + $file['size'];
    if ($size > $allow_space) { $file_space .= "[*]".$file['name']." ($file_size)"; $size = $size - $file['size']; $file_ok = 0; } } }
    if ($file_ok == 1) { $_f18 = "../_cache/".$file['name'];
    move_uploaded_file($file['tmp_name'],$_f18); $destination_file = $_SESSION['cwd'] . "/" . $file['name'];
    @ftp_put($conn, $destination_file, $_f18, FTP_BINARY); unlink($_f18); $success .= "[*]".$file['name']." ($file_size)\n"; } } } } } ftp_close($conn); } ?>
    <? if ($success == "") { ?>

    <?=$l000686?><? }
    else { ?>

    <?=$l000687?>:

    <?=$success?>
    <script language="javascript1.2"> opener.frames["filemanager"].reloadFiles();opener.frames["filemanager"].reloadSpace();</script><? } ?>
    <? if ($file_ext != "") { ?>

    <?=$l000688?>:

    <?=$file_ext?><? } ?>
    <? if ($file_max != "") { ?>

    <?=$l000689?>:

    <?=$file_max?><? } ?>
    <? if ($file_space != "") { ?>

    <?=$l000690?>:

    <?=$file_space?><? } ?>


    <form><input type="button" value="<?=$l000691?>" class="button" onclick="document.location.href='_upload.php'"></form> <? }
    else { ?><? $dir = $_SESSION['cwd'];
    $dir = str_replace($_SESSION['s11'],"",$dir);
    if ($dir == "") $dir = $_SESSION['cwd']; ?>


    <?=$l000692?>: <?=$dir?>


    <table cellspacing="2" cellpadding="2">
    <form method="post" action="?" enctype="multipart/form-data">
    <input type="hidden" name="upload" value="1">
    <? $i = 0; while($i < 10) { $i++; ?>
    <tr>
    <td bgcolor="<?=$_SESSION['color9']?>"><?=$l000491?> <?=$i?>:</td>
    <td></td>
    <td>
    <input type="file" name="upload<?=$i?>" size="40"></td>
    </tr>
    <? } ?>
    </table>


    <input type="submit" value="<?=$l000426?>" class="button"> <input type="button" class="button" value="<?=$l000068?>" onclick="window.close()"> </form>
    <? } ?>
    </body>
    </html>

  2. #2
    Un aiutino???

  3. #3
    Utente di HTML.it L'avatar di HammerFist
    Registrato dal
    May 2005
    Messaggi
    1,110
    vedi da phpinfo cosa dice a "max_execution_time"... se non hai sufficiente tempo per effettuare l'upload nn potrai caricare file troppo grandi

  4. #4
    Grazie HammerFirst, ecco alcune info da php:
    ..
    magic_quotes_gpc On On
    magic_quotes_runtime Off Off
    magic_quotes_sybase Off Off
    max_execution_time 120 120
    max_input_time -1 -1
    memory_limit 12M 12M
    upload_max_filesize 50M 50M
    ..

    potrei aggirare il problema dei 120 sec? non penso che Aruba mi aumenti il time limit.
    Thanks!

  5. #5
    Ho contattato Aruba, mi hanno risposto che:

    Gentile cliente,la informo che la dimensione massima di file caricabile nel server tramite script php è di 8Mb e tale parametro non è configurabile diversamente.

    Ho verificato nel phpinfo e c'è questo parametro:
    ..
    post_max_size 8M 8M
    ..

    Come azz faccio adesso?!! Un barbatrucco?

  6. #6
    Utente di HTML.it L'avatar di HammerFist
    Registrato dal
    May 2005
    Messaggi
    1,110
    purtroppo non si può parlare di un hosting in particolare... cmq non ci puoi fare niente, mi spiace.

  7. #7
    Opss...vero azz, sorry!
    Mi potresti mandare una email con alcuni hosting a pagam. che potrebbero fare al mio caso?
    Grazie tante per la dritta!
    Bye

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.