Jump to content

Extracting file from a Long Byte field


$username

Recommended Posts

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

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 />

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.