SunQuest
 
           General SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesGeneral SQL 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:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old May 17th, 2002, 06:23 AM
strangepup's Avatar
strangepup strangepup is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2002
Location: Phoenix, AZ
Posts: 44 strangepup User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 46 sec
Reputation Power: 7
Send a message via ICQ to strangepup
Question MORE Blobbing Data

I have a quick question regarding the Mitchell Harper article "Blobbing Data With PHP and MySQL".

Well, it seems like everything is looking good until I click on "download now" on the showfiles.php screen. When it attempts to bring up the downloadfile.php screen I get the error "Invalid blobId specified". I downloaded the support files and all that good stuff, but nothing is really sticking out.

Any suggestions?

Thanks in advance!

Reply With Quote
  #2  
Old May 17th, 2002, 12:26 PM
schwieb schwieb is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2002
Posts: 4 schwieb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I found the problem.

Blobbing Data With PHP and MySQL By: Mitchell Harper

There are some mistakes in the sample code!! I am going to try to attach the corrected code to this message. Let me know if you need further info.
Attached Files
File Type: zip storefiles.zip (3.1 KB, 631 views)

Reply With Quote
  #3  
Old May 17th, 2002, 06:35 PM
strangepup's Avatar
strangepup strangepup is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2002
Location: Phoenix, AZ
Posts: 44 strangepup User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 46 sec
Reputation Power: 7
Send a message via ICQ to strangepup
Thank you for the assist. I have gotten past that problem, but now I am faced with a new issue.

When I select "download file" from showfiles.php the next screen that comes up contains a bunch of "garbage characters". Also, above the "garbage characters" the following error is shown:
"Warning: Cannot add header information - headers already sent...(directory information)...on line 38"


Reply With Quote
  #4  
Old May 18th, 2002, 08:03 PM
mytch mytch is offline
Dev Articles Novice (500 - 999 posts)
 
Join Date: Apr 2002
Location: Sydney, Australia
Posts: 589 mytch User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Hi Guys,
I've just taken a look at the original code, and I think I bundled the wrong version of the code, so my apologies.

Schweib: I have added your code as the support material for that article. Thanks for pointing out the bugs

StrangePup: More than likely, it's the database settings in downloadfile.php. Make sure the following lines are correct:

// Database connection variables
$dbServer = "localhost";
$dbDatabase = "myFiles";
$dbUser = "admin";
$dbPass = "password";

Reply With Quote
  #5  
Old May 18th, 2002, 08:34 PM
strangepup's Avatar
strangepup strangepup is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2002
Location: Phoenix, AZ
Posts: 44 strangepup User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 46 sec
Reputation Power: 7
Send a message via ICQ to strangepup
I just realized that the problem that I am having is with graphic files. When I select "download file" then the graphic files are coming up with the garbage characters. I guess they aren't being converted properly. Is there something that I need to change on the server? Can this script be setup so that instead of bringing the file up into the web browser window, it will allow the user to save the file onto their hard drive?

Thanks

Reply With Quote
  #6  
Old June 13th, 2002, 10:49 PM
clivelr clivelr is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Location: New Zealand
Posts: 3 clivelr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to clivelr
Hi,

I have used the example files exactly as supplied in storefiles.zip.

I get any Blob that is not "jpeg" or "gif" to be displayed i.e. Text files, Html files... etc

The images are displayed as the standard "File Does Not Exist" square box with the nice red X through it. I have tried everything I can think of but the images still don't display as they should.

There is definately data being received from the field because a debugging statement of echo "<br>$fileContent<br>" displays the garbage retrieved from the field, but the:
header("Content-type: $fileType");
echo $fileContent;
just doesn't seem to work with me.

Is there something I am missing? Could it be an apache or php setting?

Any help appreciated.
Thanx
Clive

Reply With Quote
  #7  
Old June 14th, 2002, 08:14 PM
DavidM DavidM is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Posts: 78 DavidM User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Why not download mySQL front-end at http://www.anse.de/mysqlfront/, then connect to the database, click on the table, click the data tab, click on the blob field, and in the lower pane, select either "BLOB". Then you can select either the "text", "image", or "hex" tab to see the data as it was originally.

This is a handy little program for managing a mySQL database.

Reply With Quote
  #8  
Old June 16th, 2002, 03:40 PM
clivelr clivelr is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Location: New Zealand
Posts: 3 clivelr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to clivelr
Hi David,

I do have MySQL-Front.
1) When I Click the "Text" tab it shows a lot of binary data (expected for a graphic) or the correct text (if text or html)
2) When I Click the "Image" tab it shows nothing (expected due to the "addslashes" function of grabfile.php)
3) When I Click the "HEX" tab it show the data as if through a Hex Editor (as it should)

That is what is puzzling me, the data is all there, and as I said if I store a "html" file or "text" file it is displayed correctly with the dowloadfile.php, but any Image file shows as the standard Browser "File does not exist" box with the big red X through it.

Thanks
Clive

Reply With Quote
  #9  
Old January 7th, 2003, 02:11 AM
dung dung is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 1 dung User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy Store binary files into BLOB Fields!!!

Dear friend,

I try to store some binary files onto a LONGBLOB field of MySQL, uploading is OK but I could not retrieve the stored data. it seems to return a part of uploaded files?!!

For example, I stored a MS Word document and after reading that blob data field it return a file with some gabage!

Please let me know what have have to do. I'm using:
apache 1.3.24
php 4.2.0
mysql 3.23.49

Thank you.

Dung

Reply With Quote
  #10  
Old January 12th, 2003, 02:16 PM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,246 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
Dung,

What's the code you're using to store and retrieve the data?
__________________
____________________________________________
Developer Shed Weekly Writer | DevArticles Forum Moderator
Build Your Own KlipFolio Klip With PHP
FrankManno.com - Under Construction
Design Interactive Group - Under Construction

Reply With Quote
  #11  
Old February 1st, 2005, 04:35 AM
ophio ophio is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 1 ophio User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 55 m 17 sec
Reputation Power: 0
As with the majority of problems on this thread I have had problems with the following warning every time I try to download the file from the database: "Warning: Cannot add header information - headers already sent...(directory information)...on line xx"

...also like every one else I get garbage characters when an image is selected to download. Thing is text files like xml for example, which I am actually using it for are shown but I still get the header warning. Does anyone have any idea how to resolve this problem so I dont keep getting the warning. I am new to this technology and would also appreciate someone explaining what the warning actually means.

Thanks for any help!

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesGeneral SQL Development > MORE Blobbing Data


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 3 hosted by Hostway