hi !
how can i decode mail attachments uuencode( unix to unix encode ) to base64 encode
any php script ?
Thanks
sk
uuencode to base64 ?
Moderator: General Moderators
-
suhailkaleem
- Forum Newbie
- Posts: 12
- Joined: Thu Nov 07, 2002 9:11 am
- Contact:
- mydimension
- Moderator
- Posts: 531
- Joined: Tue Apr 23, 2002 6:00 pm
- Location: Lowell, MA USA
- Contact:
-
suhailkaleem
- Forum Newbie
- Posts: 12
- Joined: Thu Nov 07, 2002 9:11 am
- Contact:
ok !
here is what i got
but i still get error on this line
$encode[$i] = $b64chars[ord($encode[$i])-32];
error is : Notice: Uninitialized string offset: 76 in D:\maildf\test.php on line 15
Can any one help ?
Thanks
here is what i got
Code: Select all
<?
$filename = "1.txt";
$fd = fopen ($filename, "rb");
$code = fread ($fd, filesize ($filename));
uudecode($code) ;
function uudecode($encode) {
$b64chars="ABCDEFGHIJKLMNOPQRSTUVWXYZ\
abcdefghijklmnopqrstuvwxyz0123456789+/";
$encode = preg_replace("/^./m","",$encode);
$encode = preg_replace("/\n/m","",$encode);
for($i=0; $i<strlen($encode); $i++) {
if ($encodeї$i] == '`')
$encodeї$i] = ' ';
$encodeї$i] = $b64charsїord($encodeї$i])-32];
}
while(strlen($encode) % 4)
$encode .= "=";
$fp = fopen("2.txt" , "w");
fwrite($fp, $encode);
}
?>but i still get error on this line
$encode[$i] = $b64chars[ord($encode[$i])-32];
error is : Notice: Uninitialized string offset: 76 in D:\maildf\test.php on line 15
Can any one help ?
Thanks