I am making a program which transfers a file over a network using UDP sockets.I have already implemented protocols dealing with missing/duplicated packets and my program runs fine with text files. But for pdf files, the program is not transferring the file correctly. I am using fread() to read the file and i am using linux. Actually i want to know whether pdf files can be stored in char arrays and then transferred over the socket and then written again on the client side into pdf. Thanks in advance
Share
Sure you can… If your file-transfer-stuff can transfer characters regardless of their contents. As you state, you can transfer text-files. Then you could just try to first encode your pdf into a helper format with e.g. uuencode my.pdf somename>my.uue