الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

مشكلة في ملف تحميل ملف.

مغلق
بدأه Aboalnoor-Delphi7 في 1 فبراير 2007 · 1 رد · 547 مشاهدة · في منتدى تطوير المواقع بـ PHP
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم ورحمة الله وبركاته.

أما بعد :

عملت برنامج لتحميل الملفات وتخزين المسار في قاعدة البيانات.

وملف لتحميل الملف من الموقع :

<html dir="rtl">
<head>
<title>تحميل الملفات</title>


<meta name="keywords" content=تحميل الملفات">
<meta name="description" content=تحميل الملفات">
<link rel="stylesheet" type="text/css" href="style.css">
</head>

<?
$sql = "SELECT `filelink`,`filename` FROM `attachment` WHERE id='". $_GET["id"] ."' and  subject_id='". $_GET["PRO"] ."'";

$result = mysql_query(sql);

	   if (!result)
	   {
	   echo "error mes";
	   exit();
	   }

$rows = mysql_fetch_array($result);


				 header("Content-Disposition: attachment;filename=" . $rows['filename'] . "");
	  header("Content-type: application/download");
	  $read = @readfile($rows['filelink']);

?>

ولكن عند التنفيذ يظهر لي الخطأ التالي.

Warning: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\personalproject\includes\config.php:5) in C:\AppServ\www\personalproject\attachment.php on line 108

Warning: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\personalproject\includes\config.php:5) in C:\AppServ\www\personalproject\attachment.php on line 109

وهل توجد طريقة أفضل لإخفاء مسار الملف.

والله ولي التوفيق.

أخوكم أبو النور.

********************************************************************************

آخر وصايا سيدنا محمد صلى الله عليه وسلم:الصلاة الصلاة وما ملكت أيمانكم

66850879_b6e633000d_m.jpg

هاجر اللذائذ وانبـرى ليثـاً بادغـال الشـرا

بـاع الحيـاة رخيـصـة لله والله اشـتـرى

خذو مني فؤادي وامنحوني سلاحي أمتطي صهو المنون

فإني لم أعش لأذوق ذلاً ولا لأذوب في حضن حنون

موقع الفريق الاسلامي المتحد للبرمجة والإلكترونيات

إيميلي هو:Aboalnoor@maktoob.com

ياهو :adnanalabuo@yahoo.com

هوت ميل:AdnanAlabuo@hotmail.com

مدونتي الخاصة

#2
<?php
$sql = "SELECT `filelink`,`filename` FROM `attachment` WHERE id='". $_GET["id"] ."' and  subject_id='". $_GET["PRO"] ."'";

$result = mysql_query(sql);

	   if (!result)
	   {
	   echo "error mes";?>
<html dir="rtl">
<head>
<title>تحميل الملفات</title>


<meta name="keywords" content=تحميل الملفات">
<meta name="description" content=تحميل الملفات">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<?php
	   exit();
	   }

$rows = mysql_fetch_array($result);


				 header("Content-Disposition: attachment;filename=" . $rows['filename'] . "");
	  header("Content-type: application/download");
	  $read = @readfile($rows['filelink']);

?>

مع السلامة

تم تعديل هذه المشاركة بواسطة aziz2598 في 2 فبراير 2007 في 05:46

هذا الموضوع مغلق.

مواضيع مشابهة