Visualizzazione dei risultati da 1 a 4 su 4
  1. #1
    Utente di HTML.it
    Registrato dal
    Mar 2007
    Messaggi
    47

    max file size in formproc.php

    Salve a tutti..

    vi chiedo ancora un aiuto, spero stavolta di riceverlo.
    Sapete dirmi come inserire il limite della dimensione dei file e l'obbligo di una determinata estensione nell'upload dei files sul form "Form Processor" (formproc.php) Version: 2.03? (Script scaricato dal sito html.it: http://php.html.it/script/vedi/1216/...ocessor-script)


    Grazie!

  2. #2

  3. #3
    Utente di HTML.it
    Registrato dal
    Mar 2007
    Messaggi
    47
    Sono un poco ignorante in materia...
    Posso inserire direttamente qui qualcosa che impedisca di scaricare file maggiori del limite impostato?

    codice:
    <TD VALIGN="TOP"><DIV ALIGN="RIGHT">Foto (formato .jpg; max 2 Mb)*:</DIV></TD>
        <TD VALIGN="TOP"><INPUT TYPE="FILE" NAME="fileupload2_file2_required"></TD>

  4. #4
    Utente di HTML.it
    Registrato dal
    Mar 2007
    Messaggi
    47
    Scusa volevo dire da qui:


    Codice PHP:
            /***************************************
            ** PHP3 file upload function.
            ***************************************/
                    
    function file_upload_php3($key$value){
                            if(
    substr($key,-5) != '_file' AND substr($key,-14) != '_file_required') return FALSE;
                            if(
    substr($key,-9) == '_required' AND ($value == 'none' OR $value == '')){
                                    global 
    $required_error;
                                    
    header('Location: '.$required_error);
                                    exit;
                            }
                            if(
    $value != 'none' AND $value != ''){
                                    global 
    $num_attachments$mail;
                                    if(
    get_magic_quotes_gpc() == AND (is_long(strpos(strtolower($value), 'windows')) OR is_long(strpos(strtolower($value), 'winnt')))) $value stripslashes($value);
                                    
    $ctype $key.'_type';
                                    
    $filename $key.'_name';
                                    global $
    $filename, $$ctype;
                                    
    $attachment fread($fp fopen($value'r'), filesize($value)); fclose($fp);
                                    
    $mail->add_attachment($attachment, $$filename, $$ctype);
                                    
    $num_attachments++;
                            }
                            return 
    TRUE;
                    }

            
    /***************************************
            ** And this bit handles file uploads for
            ** php4.
            ***************************************/
                    
    function file_upload_php4($HTTP_POST_FILES){
                            if(isset(
    $HTTP_POST_FILES) AND is_array($HTTP_POST_FILES)){
                                    while(list(
    $key$attributes) = each($HTTP_POST_FILES)){
                                            if(
    $attributes['tmp_name'] != 'none' AND $attributes['tmp_name'] != ''){
                                                    global 
    $num_attachments$mail;
                                                    if(
    get_magic_quotes_gpc() == AND (is_long(strpos(strtolower($attributes['tmp_name']), 'windows')) OR is_long(strpos(strtolower($attributes['tmp_name']), 'winnt')))) $attributes['tmp_name'] = stripslashes($attributes['tmp_name']);
                                                    
    $ctype $attributes['type'];
                                                    
    $origname $attributes['name'];
                                                    
    $attachment fread($fp fopen($attributes['tmp_name'], 'r'), filesize($attributes['tmp_name'])); fclose($fp);
                                                    
    $mail->add_attachment($attachment$origname$ctype);
                                                    
    $num_attachments++;
                                            }elseif(
    substr($key, -9) == '_required'){
                                                    global 
    $required_error;
                                                    
    header('Location: '.$required_error);
                                                    exit;
                                            }
                                    }
                            }
                    } 

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.