Log in

View Full Version : Form with attachment - problems with files



ladobonline
10-05-2006, 08:25 PM
Hello,
I'm trying to do a form using mail() function to send also an attachment (I allow only .doc, .txt, .rtf and .pdf files). Here is the "base" that I'm using:
http://www.forosdelweb.com/showthread.php?t=428397&highlight=enviar+archivo+adjunto

I've been modifing the code and I'm close to wthat I want... I received the e-mail and the attachment, but (in case of .doc) is coded... it's impossible to understand!

How could I get the doc file with the original preferences?
It could be a possible solution create a zip file containing it? How?

please, I need your help!
Thanks a lot!

xeno
10-07-2006, 12:46 AM
I am not sure exactly what you mean the .doc is coded. Please elaborate.

alexjewell
10-07-2006, 12:48 PM
Because .doc's are binary, you need to specify that.



ftp_put($connect , "newfile.doc" , "oldfile.doc" , FTP_BINARY);


$connect is a variable I always define earlier in the document so I can use it for all the ftp functions.

You will need to use ftp_connect and ftp_login to get in, as well, before using this line.

$connect is just the url or IP address you're connecting to.

But the point is the FTP_BINARY...it's important.