Search code examples
javaemailoracle-adfjdeveloper

Sending mail using java : file is not getting attached from local system


I am developing a web application using Oracle ADF and jdeveloper11.1.2.4. In that I have a form to send a mail with required input fields. Example toAddress, ccAddress and attachemnt Location(input text field). I am sending mails using java mail api. I got this information from the post Mail using java

My problems is with attachment file. I am able to send an email successfully with attachment if I gave a location of the file that is on server(on which my application has deployed).

Beacause my application is web application user can access through internet. If am trying to add a location of the file that is in local system(Other than server) then file is not getting attached and mail is not getting send.

I am unable to attach a file from other than server.

Please help me. How do I achieve this. User should be able to attache a file from his/her system(local system).


Solution

  • First upload your file to server directory see- http://www.awasthiashish.com/2014/08/uploading-and-downloading-files-from.html

    Then provide a path when sending mail see-http://www.awasthiashish.com/2013/04/gmail-integration-with-oracle-adf-using.html