Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTML - delivering a file using <form 1

Status
Not open for further replies.

tempo1

Programmer
Feb 20, 2007
118
0
0
Hi everyone,
I added a "FORM" in my html page to enable the user send me a file via mail. The code is:
Code:
<html>
  <head>
    <title>
      send_me_a_file
    </title>
  </head>

<body>
  
  <form action="mailto:mymail@mail.com?subject="myfile" enctype="text/plain" 
   name="regiser" method="post">       
  <INPUT TYPE="file" name="send_me_a_file" size="20"> 
  <INPUT TYPE="submit" value="send_file" name="regiser" method="post" dir="rtl">
</form>    
</body>
</html>
The problem is that what i get in my mail is the file's name only. I'd like to get the file itself not its name.
Can anyone help me with that ?
Thanks.
 
While I'm not 100% sure on this, I'm fairly sure you'd need to post the form to a server and get that to send the mail with attachment... I'm not sure you can do it client-side.

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Hi Sleidia,
And thanks. I recieved in my mailbox a file attached carrying the name:
"postdata.att"
.
I opened the file and there i found the name of the file but not the file itself.
Thanks anyway
 
Hi Tempo,

Using a script like that on your page is an open invitation to the spambots to collect your email address and send you lots of spam.

Use a proper script. If you try this one it will step you through the process and do what you need (attach files)in whichever language you need for your server. Even newbies can use this one.
 
Thank a lot jillC
I never wrote a script and i guess i should.
Can you recommend which is better: PHP or ASP?
"Better" i mean: does more, easy to learn and more common
Thanks a lot
 
You need to find out what language is available to you on your server. You ask your ISP or hosting company what you can use and go from there. If you have Linux hosting, you'll probably use PHP. If you have Windows hosting, you'll probably use ASP. Personally, I think PHP is easier, however if you use a script which you have to pay for you usually get the assurance that they'll be able to answer any of your questions and/or sort out your problems. Anyway you can get by without knowing too much if you use commercially available scripts.

There are lots of discussions about languages in these forums. If you do a search you might find some of them. The mad keen ones seem to tell you to learn several languages. I get by with a reasonable understanding of html and css and a smattering of PHP, ASP and javascript.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top