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! 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. 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! 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
Archived
This topic is now archived and is closed to further replies.