Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



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

Posts: 13
Name: Richi
Trades: 0
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
 
 
Register now for full access!
Old 10-05-2007, 02:09 AM Re: field type for PDF in MySQL
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
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.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 10-05-2007, 05:14 AM Re: field type for PDF in MySQL
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
http://www.w3schools.com/media/media_mimeref.asp
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-05-2007, 05:40 AM Re: field type for PDF in MySQL
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Thanks Chris.
I've added this in my "references" bookmarks.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 10-05-2007, 08:33 AM Re: field type for PDF in MySQL
acm001's Avatar
Novice Talker

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

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
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 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.33373 seconds with 12 queries