pipobona Posted November 25, 2005 Posted November 25, 2005 (edited) Hi all, I got a question about sending image files though TCP/UDP protocol I know how to send just text and stuff , but what do you think , is it possible to open a .jpg file for example , read all the code and send the code through TCP/UDP and then on the other side of the net save it back to .jpg ? Thanks in advance (sorry for placign in the wrong category) Edited November 25, 2005 by pipobona
Greenseed Posted November 26, 2005 Posted November 26, 2005 try read your file into a variable like $handle= fileopen("fichier") $fileread = fileread("fichier",0) $filebinary _stringtohex($fileread) after you make $filetowrite = _hextostring($filebinary) filewrite($filetowrite) when you read a file to a variable it keep the special caractere but you can print out! it why you have to convert to hex if you wanna print it ou send it. if the file is to big make same but line by line i do this to include binary file in script under format of txt file it better than a file install. because you can edut the file before install it! anyway it another story hehe! GreenseedMCSE+I, CCNA, A+Canada, QuebecMake Love Around You.
Greenseed Posted November 27, 2005 Posted November 27, 2005 I forgot i you try it. Make your transfer of file over a TCP connection! because UDP connection are less error correction and checking! for file transfer you need TCP always! GreenseedMCSE+I, CCNA, A+Canada, QuebecMake Love Around You.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now