|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
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
|
||||
|
||||
|
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! |
|
#2
|
|||
|
|||
|
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. ![]() |
|
#3
|
||||
|
||||
|
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" ![]() |
|
#4
|
|||
|
|||
|
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"; |
|
#5
|
||||
|
||||
|
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 |
|
#6
|
|||
|
|||
|
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 |
|
#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. |
|
#8
|
|||
|
|||
|
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 |
|
#9
|
|||
|
|||
|
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 |
|
#10
|
|||
|
|||
|
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 |
|
#11
|
|||
|
|||
|
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! |
![]() |
| Viewing: Dev Articles Community Forums > Databases > General SQL Development > MORE Blobbing Data |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|