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:
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 October 30th, 2002, 01:50 AM
infamous-online infamous-online is offline
Moderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Posts: 404 infamous-online User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 m 10 sec
Reputation Power: 7
Uploading To Mysql Question...

on the grabfile.php why do i keep getting this error?

You must enter both a description and file
__________________
Apache Expert

Reply With Quote
  #2  
Old October 30th, 2002, 02:30 AM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
could you elaborate on your question?? it doesnt make much sense like that

Reply With Quote
  #3  
Old October 30th, 2002, 08:36 AM
infamous-online infamous-online is offline
Moderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Posts: 404 infamous-online User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 m 10 sec
Reputation Power: 7
oh sorry i should have been more specific but mytch's blobbing mysql article i got the getfiles.php script working but after i hit the submit button, i get the "You must enter both a description and file" from grabfile.php . i wonder what have i done wrong. i will attach the file here to see why doesn't my script work like his.
Attached Files
File Type: txt grabfile.txt (1.4 KB, 244 views)

Reply With Quote
  #4  
Old October 30th, 2002, 05:01 PM
wAr-AnGeL wAr-AnGeL is offline
Forum Security
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Behind You
Posts: 479 wAr-AnGeL User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m
Reputation Power: 7
Send a message via ICQ to wAr-AnGeL Send a message via AIM to wAr-AnGeL
it means you must select a file to upload and a description about it, if you did make sure you named the description form field strDesc and the browse form field fileUpload.
__________________




"Only Linux users see the end of crashes."
- Pl4t0

Reply With Quote
  #5  
Old October 30th, 2002, 06:09 PM
infamous-online infamous-online is offline
Moderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Posts: 404 infamous-online User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 m 10 sec
Reputation Power: 7
Quote:
Originally posted by wAr-AnGeL
it means you must select a file to upload and a description about it, if you did make sure you named the description form field strDesc and the browse form field fileUpload.


i entered information in both fields, but i am a bit confused about the rest of your post. could you break that down in dummy terms.

Last edited by asp_man : October 30th, 2002 at 06:15 PM.

Reply With Quote
  #6  
Old November 1st, 2002, 01:22 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: 7
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
I think what he means is, did you make sure that your "Description" text field (in the upload form) is named "strDesc", and that the field in which you select your file to upload, is named "fileUpload".

Can you post your "<form....>" section?
__________________
____________________________________________
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
  #7  
Old November 1st, 2002, 08:36 PM
infamous-online infamous-online is offline
Moderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Posts: 404 infamous-online User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 m 10 sec
Reputation Power: 7
Quote:
Originally posted by FrankieShakes
I think what he means is, did you make sure that your "Description" text field (in the upload form) is named "strDesc", and that the field in which you select your file to upload, is named "fileUpload".

Can you post your "<form....>" section?


ok i can do that but which file though sorry?

Reply With Quote
  #8  
Old November 1st, 2002, 08:50 PM
wAr-AnGeL wAr-AnGeL is offline
Forum Security
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Behind You
Posts: 479 wAr-AnGeL User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m
Reputation Power: 7
Send a message via ICQ to wAr-AnGeL Send a message via AIM to wAr-AnGeL
the file with the form which asks you to select a file & enter a description

Reply With Quote
  #9  
Old November 2nd, 2002, 12:23 AM
infamous-online infamous-online is offline
Moderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Posts: 404 infamous-online User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 m 10 sec
Reputation Power: 7
Lightbulb

heres the file
Attached Files
File Type: txt getfiles.txt (1.9 KB, 266 views)

Reply With Quote
  #10  
Old November 2nd, 2002, 10:43 AM
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: 7
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
Okay, I took at look at the form fields, and they seem to be correct. Onto your PHP configuration:

Do you have your "register_globals" set to off? You'll need to check, and if so, you'll have to modify the code to make use of the superglobal arrays: $_POST, $_GET, etc...

For more info, check out the php manual.

Reply With Quote
  #11  
Old November 2nd, 2002, 11:36 PM
infamous-online infamous-online is offline
Moderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Posts: 404 infamous-online User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 m 10 sec
Reputation Power: 7
Thumbs down

ok guys it will let me upload and whatnot but when i click on the link to download the file theres a problem. the image is blank and it shows the description and all but it shows nothing. what could be causing it. i am on a windows 2000 machine.

Last edited by asp_man : November 3rd, 2002 at 01:02 AM.

Reply With Quote
  #12  
Old November 9th, 2002, 01:17 AM
infamous-online infamous-online is offline
Moderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Posts: 404 infamous-online User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 m 10 sec
Reputation Power: 7
Angry

bump

Reply With Quote
  #13  
Old November 9th, 2002, 02:04 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: 7
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
What code are you using to download the files? The scripts you posted above were only for storing the file in the db.

Reply With Quote
  #14  
Old November 10th, 2002, 01:28 AM
infamous-online infamous-online is offline
Moderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Posts: 404 infamous-online User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 m 10 sec
Reputation Power: 7
Quote:
Originally posted by FrankieShakes
What code are you using to download the files? The scripts you posted above were only for storing the file in the db.



showfiles.php
PHP Code:
<?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?blobId=<?php echo $row["blobId"]; ?>">
        Download now
    </a></font>
  </td>
  </tr>

<?php
  
}

  echo 
"</table>";
?>

Reply With Quote
  #15  
Old November 10th, 2002, 01:31 AM
infamous-online infamous-online is offline
Moderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Posts: 404 infamous-online User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 m 10 sec
Reputation Power: 7
downloadfile.php

PHP Code:
<?php

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

// Database connection variables
$dbServer "localhost";
$dbDatabase "myFiles";
$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($result0"blobType");
    
$fileContent = @mysql_result($result0"blobData");
        
    
header("Content-type: $fileType");
    echo 
$fileContent;
}
else
{
    echo 
"Record doesn't exist.";
}
    
?>

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > Uploading To Mysql Question...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Linear Mode Linear Mode