MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

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 June 3rd, 2003, 11:00 AM
sweetmoon sweetmoon is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 11 sweetmoon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy PDF's in MySql

Iam storing some of my pdf files in MySql database.But when i pull the files to show up in browser iam not getting a pdf file, i just get the binary on my browser to show up.

IS there are any alternate way that i can handle this problem?

Reply With Quote
  #2  
Old June 3rd, 2003, 11:31 AM
iahmed iahmed is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2003
Location: USA
Posts: 171 iahmed User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 42 m 58 sec
Reputation Power: 6
what is your column type?

Reply With Quote
  #3  
Old June 3rd, 2003, 12:20 PM
sweetmoon sweetmoon is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 11 sweetmoon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
columntype is blob

Reply With Quote
  #4  
Old June 3rd, 2003, 07:42 PM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 8 m 57 sec
Reputation Power: 9
Send a message via ICQ to stumpy Send a message via MSN to stumpy
You need to set the "content-type" header of the page before streaming the binary to it.

PDF's content type is: application/pdf

The actual code to set it is different for each language (which you did not metion)
__________________
DevArticles Moderator
BlueSix - Web Development and Consulting

Reply With Quote
  #5  
Old June 6th, 2003, 11:07 AM
sweetmoon sweetmoon is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 11 sweetmoon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
This is thecode iam using for pulling those pdfs from MySql database and show it in browser


<cfquery name="pullpdfqry" datasource="TOD">
SELECT FileName,FileData
FROM Files
WHERE ID = 54
</cfquery>



<cfcontent type="application/pdf" file="#pullpdfqry.FileData#" deletefile="yes" >

I get an error msg saying bytearray objects cannot be converted to strings.

Reply With Quote
  #6  
Old June 27th, 2003, 01:58 PM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
Why don't you just store a reference to the PDFs in the database and store the PDFs in the filesystem? My understanding is that blobs are inefficient. Then all you'd need to do would be either to redirect to the PDF in question or to open it up and spit it out. I'm in favor of redirecting, though if you need to keep the files out of the web tree, you'd need to open and spit it out.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > PDF's in MySql


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 | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT