954,604 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Need file upload code for word Doc

Im looking for a simple code for users on my webpage to upload a .doc or .txt file to my email address. I've only found ones in CGI which i can't use and the one i tried only send it in binary code and not the actual word doc. Does anyone have a simple code that I can use?

kgonsalv
Newbie Poster
2 posts since Mar 2006
Reputation Points: 10
Solved Threads: 0
 

Upload to your email address? Hmmm.

You can have the user upload any file at all, by placing a file upload element on your page.

<input type="file">


There are some optional attributes, such as ID or NAME, and SIZE (referring to the size of the textbox, not the size of the file.

The form must be properly encoded to allow files to be posted, add the enctype="multipart/form-data" key-value pair to your FORM element.

Once it's on the server, you'd use whatever server-side language you use to process the file, which could include emailing it somewhere.

tgreer
Made Her Cry
Team Colleague
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37
 

I've done the coding of the basic form, (similar to above) tested it and got the email through correctly, but the file I was trying to upload didn't come with it. Do I have to put anything on the server to actually have the file come through?

Any help appreciated.

UWATANG
Newbie Poster
2 posts since Aug 2010
Reputation Points: 10
Solved Threads: 0
 

I have never used PHP before, but I think the answer lies in me learning how that works! I got a PHP script to send a file to a server. Brilliant for a beginner! But now I want to put a message from a form together with an uploaded file, and have both the form message and the file sent to an email address. I also want to restrict the size of the file being uploaded and make it only a word doc or pdf. Any advice appreciated. Thanks tgreer for the ID attributes tip.

UWATANG
Newbie Poster
2 posts since Aug 2010
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You