General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

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:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old September 17th, 2002, 06:10 AM
imagenow imagenow is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Posts: 3 imagenow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy Error in BLOBBING..

Hi guys,
I'm working on the BLOBBING tutotial.. all working but not the download. The datas are correctly stored in the DB, are shown but when I click on the DOWNLOAD link i got a:

Invalid blobId specified

why?

The ID is present on the DB but...?

Please help.

Reply With Quote
  #2  
Old September 17th, 2002, 08:02 AM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Could you please post the code thats causing the error.

Thanks

Reply With Quote
  #3  
Old September 17th, 2002, 09:31 AM
imagenow imagenow is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Posts: 3 imagenow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Post

here's the codes...

thanks

---------showfiles.php-----------
<?php
// Database connection variables
$dbServer = ************
$dbDatabase = ************
$dbUser = ************
$dbPass = ************

$sConn = mysql_connect($dbServer, $dbUser, $dbPass)
or die("Couldn't connect to database server");

$dConn = mysql_select_db($dbDatabase, $sConn)
or die("Couldn't connect to database $dbDatabase");

$dbQuery = "SELECT blobId, blobTitle, blobType ";
$dbQuery .= "FROM myBlobs ";
$dbQuery .= "ORDER BY blobTitle ASC";

$result = mysql_query($dbQuery) or die("Couldn't get file list");

?>

<a href="http://www.devarticles.com"><img border="0" src="http://www.devarticles.com/dlogo.gif"></a>

<table border="1" cellpadding="0" cellspacing="0" bordercolor="#111111" width="100%">

<tr>

<td width="34%" bgcolor="#FF9900" height="21">
<p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF">
Description</font></b></td>

<td width="33%" bgcolor="#FF9900" height="21">
<p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF">
Type</font></b></td>

<td width="33%" bgcolor="#FF9900" height="21">
<p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF">
File</font></b></td>

</tr>

<?php
while($row = mysql_fetch_array($result))
{
?>

<tr>
<td width="34%" bgcolor="#FFDCA8" height="21">
<p style="margin-left: 10; margin-right: 10">
<font face="Verdana" size="1">
<?php echo $row["blobTitle"]; ?>
</font>
</td>

<td width="33%" bgcolor="#FFDCA8" height="21">
<p style="margin-left: 10">
<font face="Verdana" size="1">
<?php echo $row["blobType"]; ?>
</font>
</td>

<td width="33%" bgcolor="#FFDCA8" height="21">
<p style="margin-left: 10"><font face="Verdana" size="1">
<a href="downloadfile.php?fileId=<?php echo $row["blobId"]; ?>">
Download now
</a></font>
</td>
</tr>

<?php
}

echo "</table>";
?>
---------------------end----------------


-----------------downloadfile.php-------
<?php

global $blobId;

if(!is_numeric($blobId))
die("Invalid blobId specified");

// Database connection variables
$dbServer = ************
$dbDatabase = ************
$dbUser = ************
$dbPass = ************

$sConn = mysql_connect($dbServer, $dbUser, $dbPass)
or die("Couldn't connect to database server");

$dConn = mysql_select_db($dbDatabase, $sConn)
or die("Couldn't connect to database $dbDatabase");

$dbQuery = "SELECT blobType, blobData ";
$dbQuery .= "FROM myBlobs ";
$dbQuery .= "WHERE blobId = $blobId";

$result = mysql_query($dbQuery) or die("Couldn't get file list");

if(mysql_num_rows($result) == 1)
{
$fileType = @mysql_result($result, 0, "blobType");
$fileContent = @mysql_result($result, 0, "blobData");

header("Content-type: $fileType");
echo $fileContent;
}
else
{
echo "Record doesn't exist.";
}

?>
---------------------end----------------

Reply With Quote
  #4  
Old September 17th, 2002, 11:28 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
I always got that error too! Never did figure it out.
__________________
Web Solutions For Everyone @
Strangepup.com


Reply With Quote
  #5  
Old September 17th, 2002, 12:13 PM
imagenow imagenow is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Posts: 3 imagenow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I GOT IT!!! (but testing now...)

Hi changed the variable needed for the SELECT in the downloadfile.php file.

$dbQuery .= "WHERE blobId = $fileId";

and rem the $blobID:

#global $blobId;

#if(!is_numeric($blobId))
#die("Invalid blobId specified");


Now it works but don't know if this will cause any malfunction....

if you guys out there have any news...

bye

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > Error in BLOBBING..


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 | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway