הרשם שאלות ותשובות רשימת חברים לוח שנה חיפוש הודעות מהיום סמן פורומים כנקראו

   
|!|

 
 
כלים לאשכול תצורת הצגה
Prev הודעה קודמת   הודעה הבאה Next
ישן 01-09-06, 08:33   # 1
Elad-A
הוסטסניון
 
מיני פרופיל
תאריך הצטרפות: May 2006
הודעות: 1,987

Elad-A לא מחובר  

[PHP] עזרה ב HEADER

עריכה:

הצלחתי לסדר שיוריד אבל הקבצים יוצאים פגומים.

זה הקוד:

PHP קוד:

<? ob_start(); ?>
<?php
function download_file($file) 
{ 


$query = mysql_query("SELECT * FROM upload where id = '{$_GET['id']}'") or die("error"); 
$row = mysql_fetch_array($query); 
$num = mysql_num_rows($query); 
if(
$num == 0) 
{ 
die(
" לא קיימת הורדה התואמת לחפושך ") ; 
} 
$id = $row['id']; 
$name = $row['name']; 
$size = $row['size']; 
$type = $row['type']; 
// By maor 
    
$filename           = basename($file); 
    
$file_extension     = strtolower(substr(strrchr($filename,"."),1)); 
    
$input  = strtolower($_SERVER['QUERY_STRING']); 
    
$no_good_extensions = array("php"."php1","php2","php3","php4"); 
    
$return = str_replace($no_good_extensions, "", $input); 
     if( 
$input != $return ) 
    { 
    die( 
" סוג הקובץ שאתה מנסה להוריד לא מורשה "); 
    } 
$file = $row['name'];
header ("Content-type: application/$type"); 
header ("Content-disposition: attachment; filename=".$file.";"); 
header("Content-Length: ".filesize($file)); 
readfile($file); 
exit; 
} 
download_file(date/$name);
?>
אם בא לכם לנסות אתם מוזמנים לבדוק:

http://elad.fire-serv.net/test.php

עריכה 2 :

הסתדרתי כבר תודה בכל מקרה.
תודה ל lalamen שעזר לי.

Last edited by Elad-A; 01-09-06 at 09:50..
  Reply With Quote
 

חברים פעילים הצופים באשכול זה: 1 (0 חברים ו- 1 אורחים)
 

כלים לאשכול
תצורת הצגה

חוקי פירסום
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is מופעל
סמיילים הם מופעל
[IMG] קוד מופעל
קוד HTML מכובה

קפיצה לפורום


כל הזמנים הם GMT +2. הזמן כעת הוא 13:07.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ