rma.eugene Posted June 2, 2010 Share Posted June 2, 2010 Hey all, Trying to retrieve a base64 file from db and ask user if he/she wishes to download it. what i've got: $file = base64_decode($record->fields->Body); header('Content-Type: ' . $record->fields->ContentType); readfile($file); thanks! Quote Link to comment https://forums.phpfreaks.com/topic/203683-decode-base64-file-and-open/ Share on other sites More sharing options...
premiso Posted June 2, 2010 Share Posted June 2, 2010 I think all you need to do is just echo $file instead of readfile. readfile is generally for passing a path to a valid file and actually reading it. Since the file data is stored in the DB, just echo it. Quote Link to comment https://forums.phpfreaks.com/topic/203683-decode-base64-file-and-open/#findComment-1066873 Share on other sites More sharing options...
rma.eugene Posted June 2, 2010 Author Share Posted June 2, 2010 Oh yeah that was simple & really hanging me up. thanks! Quote Link to comment https://forums.phpfreaks.com/topic/203683-decode-base64-file-and-open/#findComment-1066880 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.