944,028 Members | Top Members by Rank

Ad:
Mar 22nd, 2006
0

Need file upload code for word Doc

Expand Post »
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?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
kgonsalv is offline Offline
2 posts
since Mar 2006
Mar 22nd, 2006
0

Re: Need file upload code for word Doc

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.

HTML and CSS Syntax (Toggle Plain Text)
  1. <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.
Team Colleague
Reputation Points: 227
Solved Threads: 37
Made Her Cry
tgreer is offline Offline
1,697 posts
since Dec 2004
Aug 14th, 2010
0
Re: Need file upload code for word Doc
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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
UWATANG is offline Offline
2 posts
since Aug 2010
Aug 22nd, 2010
0

UWATANG

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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
UWATANG is offline Offline
2 posts
since Aug 2010

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in HTML and CSS Forum Timeline: Text displays differently in IE and Firefox
Next Thread in HTML and CSS Forum Timeline: Dreamweaver Unexplainable gap





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC