Results 1 to 3 of 3

Thread: Form with attachment - problems with files

  1. #1
    Join Date
    Oct 2006
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Form with attachment - problems with files

    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/showthrea...rchivo+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!

  2. #2
    Join Date
    Jul 2005
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I am not sure exactly what you mean the .doc is coded. Please elaborate.

  3. #3
    Join Date
    Mar 2006
    Location
    Cleveland, Ohio
    Posts
    574
    Thanks
    6
    Thanked 5 Times in 5 Posts

    Default

    Because .doc's are binary, you need to specify that.

    PHP Code:
    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.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •