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!

send attachment from client machine

Status
Not open for further replies.

dvsmas

Programmer
Jun 20, 2001
16
0
0
US
Can anyone please help me with this:
I need to send an attachment located on the client machine. I know how to do this through java mail API if the attachments are located on the server. Basically I would like to know if there is any javascript or any java classes available.

Thanks in advance

 
Javascript cannot access files on the users computer.

You could use a cgi script on your server to get a file from the user and process it on your server. This would require knowledge of something like perl or php.

In order to send a file to a cgi script, you need to make a form with a "file" field.

Here's a sample file field:
<input type=&quot;file&quot; name=&quot;file&quot; size=30>

You could use javascript to fill in that file field with the name of the file if that's what you need, but you gotta use a special trick to get around the security.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top