Why when sending a form to the mail only the file name is sent, but the file itself is not?

<form action="mailto:rproger@mail.ru" method="post" enctype="text/plain"> <input type="file" name="foto" size=50 value="ваш аватар"> <input type="submit"><input type="reset"> 
  • 2
    Because "Gladiolus"! =) And in essence: where is the code (form and handler)? - DemoS
  • Fill in pastebin.com form code, and script code that processes it. The level of our extrasensory abilities today is not great, due to the growing phase of the moon and the Gilgokesky solstice. Therefore, it is very difficult to understand the problem without code. Excuse me. - Jakeroid
  • @Roma Proger To format the code, select it with the mouse and click on the button 101010 of the editor. - Nicolas Chabanovsky
  • one
    @ HashCode This text should be put as a banner with an indication of the formatting icon))) And a flash banner is better, like a video clip to be straight) - Palmervan
  • I do not see the closing form tag: </ form> - Andrey Arshinov

2 answers 2

Usually, files are transferred via this form <form action="/upload.php" method="post" enctype="multipart/form-data"><input type="file" name="userfile" /></form>

And in php you need to take using $_FILES['userfile']; and check.

  • enctype = "multipart / form-data" - Favorite

Because enctype="multipart/form-data" necessary, not enctype="text/plain" .