General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old May 20th, 2002, 01:51 AM
rathaur rathaur is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Malaysia
Posts: 82 rathaur User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 42 m 57 sec
Reputation Power: 17
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.

Reply With Quote
  #2  
Old May 20th, 2002, 09:37 PM
mytch mytch is offline
Dev Articles Novice (500 - 999 posts)
 
Join Date: Apr 2002
Location: Sydney, Australia
Posts: 588 mytch User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 17
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.

Reply With Quote
  #3  
Old May 23rd, 2002, 03:04 AM
rathaur rathaur is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Malaysia
Posts: 82 rathaur User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 42 m 57 sec
Reputation Power: 17
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.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > problem with header


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap