Solved

upload a file using http

Posted on 2004-03-31
6
542 Views
Last Modified: 2012-06-27
I want to upload  a file as attachment to my IIS server using http.Due to certain constraints i can't use java mail or other technology like xml soap.I can only use java.net .Please help.
Thanks in advance

0
Comment
Question by:chakra-march-04
  • 2
  • 2
6 Comments
 
LVL 13

Accepted Solution

by:
Webstorm earned 63 total points
ID: 10724162
Hi chakra-march-04,

You can use an URL object to POST the file content :
http://java.sun.com/j2se/1.4.2/docs/api/java/net/URL.html
http://java.sun.com/j2se/1.4.2/docs/api/java/net/URLConnection.html
or you can use the PUT http method.

0
 
LVL 13

Expert Comment

by:Webstorm
ID: 10724196
0
 
LVL 16

Assisted Solution

by:gnoon
gnoon earned 62 total points
ID: 10729383
Also you can use w3JMail component to do upload attachments.
http://www.dimac.net/Products/w3JMail/Version43/Examples/Attachments.htm
0
 
LVL 16

Expert Comment

by:gnoon
ID: 10729501
>Also you can use w3JMail component to do upload attachments.
Sorry, it's w3Upload component, not w3JMail.
http://www.dimac.net/Products/w3Upload/Reference/Upload.htm#example
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
This video teaches viewers about errors in exception handling.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question