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

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.