$username Posted September 14, 2008 Share Posted September 14, 2008 Hello All, I am working on a extracting info from maxdb. Right now I would like to test this to see if I can build something to view info in this database. There is this field called "DIST_FILE" This a long byte column in maxdb. To my knowledge this is in b64 encoding. //select the info $sql = maxdb_query("SELECT DIST_FILE FROM DBM350_FGFAXOUT WHERE MSN = '22'"); $file = maxdb_fetch_assoc($sql); //decode the field $filedl = base64_decode($file); //Set header for download header("Content-Disposition: attachment; filename=test"); echo "$filedl"; Does this look even close to something to download the data? Thank you, Brett Link to comment https://forums.phpfreaks.com/topic/124244-extracting-file-from-a-long-byte-field/ Share on other sites More sharing options...
$username Posted September 14, 2008 Author Share Posted September 14, 2008 New Code But new error <?php include 'dbconnect.php'; $sql = "SELECT * FROM DBM350_FGFAXOUT WHERE MSN = '22'"; $result = maxdb_query($link, $sql) or die(maxdb_error()); list($DIST_FILE) = maxdb_fetch_array($result); header("Content-Disposition: attachment; filename=test"); header("Content-length: 55"); header("Content-type: tif"); Echo "$DIST_FILE"; ?> <br /> <b>Warning</b>: maxdb_fetch_array() [<a href='function.maxdb-fetch-array'>function.maxdb-fetch-array</a>]: Column/Parameter 111 truncated. in <b>C:\Inetpub\wwwroot\work\dl.php</b> on line <b>7</b><br /> Link to comment https://forums.phpfreaks.com/topic/124244-extracting-file-from-a-long-byte-field/#findComment-641574 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.