Reply
field type for PDF in MySQL
Old 10-04-2007, 10:22 PM field type for PDF in MySQL
acm001's Avatar
Novice Talker

Posts: 13
Name: Richi
hey everyone i was just wondering what field type are we suppose to have for PDF files in MySQL database?
is it LONGBLOB?
becuase everytime i upload something to it from a PHP form, and try to download it, opens as a .txt format.
can anyone help me?
acm001 is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 10-05-2007, 01:09 AM Re: field type for PDF in MySQL
tripy's Avatar
Fetchez la vache!

Posts: 1,981
Name: Thierry
Location: In the void
It's because when your datas comes from the db, the magic file process is not trigerred.
To correct this, y ou must add a
PHP Code:
header('content-type:{your file type mime}'); 
to tell the browser what type of file it is.
You'll have to look up the mime-type, I don't know it.

In web environment, the default file type is text if nothings specified.
__________________
Listen to the ducky: "This is awesome!!!"

tripy is offline
Reply With Quote
View Public Profile
 
Old 10-05-2007, 04:14 AM Re: field type for PDF in MySQL
chrishirst's Avatar
Super Moderator

Posts: 12,752
Location: Blackpool. UK
http://www.w3schools.com/media/media_mimeref.asp
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-05-2007, 04:40 AM Re: field type for PDF in MySQL
tripy's Avatar
Fetchez la vache!

Posts: 1,981
Name: Thierry
Location: In the void
Thanks Chris.
I've added this in my "references" bookmarks.
__________________
Listen to the ducky: "This is awesome!!!"

tripy is offline
Reply With Quote
View Public Profile
 
Old 10-05-2007, 07:33 AM Re: field type for PDF in MySQL
acm001's Avatar
Novice Talker

Posts: 13
Name: Richi
thanx everyone
acm001 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to field type for PDF in MySQL
 

Thread Tools

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.13814 seconds with 13 queries