View Single Post
ישן 24-03-08, 00:21   # 1
Dum
חבר מתקדם
 
מיני פרופיל
תאריך הצטרפות: Feb 2006
הודעות: 552

Dum לא מחובר  

PHP - העלאת קבצים, אישור לסיומת מסוימת

היי,
איך בקוד הבא אני מאפשר לעלות רק סיומת של JPG לדוגמא

PHP קוד:
<?php 
if (isset($_POST['check_if_press']) && $_POST['check_if_press'] == "send_file")  



    if (!empty(
$_FILES['my_file']['name']))  
    { 
        
$dir getcwd()."/"
        
move_uploaded_file($_FILES['my_file']['tmp_name'] , $dir.$_FILES['my_file']['name']);  
        echo 
"Weldone, You have been uploaded the file."
    } 


?> 

<form action="<?php echo $PHP_SELF?>" method="post" enctype="multipart/form-data">  
    Upload file: <input type="file" name="my_file" /><br /> 
  <input type="submit" name="check_if_press" value="send_file"  /> 
</form>
__________________
עבודה מהבית
  Reply With Quote