|
|
|||||||||
|
|||||||||
|
|||||||||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
problem with header
Hi
I am using Db ( mysql) to blob in some files. The loading into db is okay, but the problem is when viewing the stored data of different format. Some I could easily open it, and others gives error. I could view/open images and html but opening a .doc or .xls is a problem. It pop up message : " internet explorer cant download grade.php from localhost " OR else sometimes it opens in plain html format with funny characters ( ascii code) . My enviroment is : Win Apache Php 4.1 Mysql Window 98 Office 97 Below is my code: <? include("../lib/config.inc"); include("../lib/dblib.inc"); include("../lib/lib.inc"); $query="select * from ece1011_1_1 where stdnt_rollnum=890234 "; $result=mysql_query($query) or die("Unable to get file :".mysql_error()); $data=mysql_result($result,0,"file_data"); $type=mysql_result($result,0,"file_type"); $file =mysql_result($result,0,"file_name"); Header("Content-type: $type"); //print($data); //echo " $type, $file<br>"; echo $data; ?> Thanks for you guys comments and help. I need to solve this asap. Thanks
__________________
Rathaur ====================== Knowledge is Power Last edited by rathaur : May 20th, 2002 at 01:58 AM. |
|
#2
|
|||
|
|||
|
Hey Rathur,
What header types have you saved for them in the database? That might be where the problem lies. Also, are the included files outputting anything? THey shouldnt be. |
|
#3
|
|||
|
|||
|
Hi mytch
The include files doesnt print anything. They contain variables defined and some functions which need to be invoked. The type of file is fetched as in your article. ( fecthed by PHP into the form_data, form_data_type ) Is that what you meant by header type ? for word the type loaded is application/msword . The imagers ,text and html files can be opened easily by the script but so strange the word, xls cant. PLease do advice .. need to solve this asap Thanks Last edited by rathaur : May 23rd, 2002 at 04:00 AM. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > problem with header |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|