Hi,
Does anyone know anything about uuencoding?
I am looking for a class that will encode a binary file. There are some uuencode functions within php but they are for strings as far as I know.
Thanks,
Rob.
Uuencode
Moderator: General Moderators
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
What is this uuencoding?
Looks the functions are binary safe by the way
Looks the functions are binary safe by the way
So untested but....php.net wrote: string convert_uuencode ( string data )
convert_uuencode() encodes a string using the uuencode algorithm.
Uuencode translates all strings (including binary's ones) into printable characters, making them safe for network transmissions. Uuencoded data is about 35% larger than the original.
Code: Select all
$filename = './dir/file.ext';
$string_data = file_get_contents($filename);
$encoded_data = convert_uuencode($string_data);-
spacebiscuit
- Forum Contributor
- Posts: 390
- Joined: Mon Mar 07, 2005 3:20 pm
Hi,
Uuencode I believe is an encoding used for mail attachments within emails. The Uuencode function within php is for strings - I need one that will operate on a file. I have done a thorough search and cannot find anything. I may need to encode the file with a stand alone application I think.
I'll let you know.
Rob.
Uuencode I believe is an encoding used for mail attachments within emails. The Uuencode function within php is for strings - I need one that will operate on a file. I have done a thorough search and cannot find anything. I may need to encode the file with a stand alone application I think.
I'll let you know.
Rob.
-
spacebiscuit
- Forum Contributor
- Posts: 390
- Joined: Mon Mar 07, 2005 3:20 pm
-
spacebiscuit
- Forum Contributor
- Posts: 390
- Joined: Mon Mar 07, 2005 3:20 pm
I thnk php only works on strings and not files. When I encoded with the php function the resulting file was incorrect. The file structure was not correct. Images encoded with uuencode should have the following format:
begin 0666 1.jpg
M_]C_X``02D9)1@`!`0$`2`!(``#_X0EF17AI9@``24DJ``@````*``\!`@`&
M````A@```!`!`@`.````C````!(!`P`!`````0```!H!!0`!````F@```!L!
end
That is they start with 'begin .......' finsh with 'end' and each line inbetween starts with an M. Try it on a file with the php function and it doesn't have this structure.
Rob.
begin 0666 1.jpg
M_]C_X``02D9)1@`!`0$`2`!(``#_X0EF17AI9@``24DJ``@````*``\!`@`&
M````A@```!`!`@`.````C````!(!`P`!`````0```!H!!0`!````F@```!L!
end
That is they start with 'begin .......' finsh with 'end' and each line inbetween starts with an M. Try it on a file with the php function and it doesn't have this structure.
Rob.