I want to download the selected attachments from my gmail accout by using javamail.Is it possible?How can i acheive this?
The actual need is i want to download only the selected files from my attachments.
Here they gives detail about download all attachments.But in my case,i will select one or more mails with attachments and the selected mails only needs to be download.
How can i get the selected mail ids from my code.
Plz give some solution.
That FAQ entry doesn't tell you how to download all attachments, it tells you how to download any attachment.
You have to write the code that selects which attachment you want, based on whatever your criteria are.
Are you perhaps asking how to use the Folder.search method?
I have downloaded attachments from my gmail account to local drive by using JavaMailApi.
i will show the message subjects in my webpage.If i click the subject the corresponding attachment will be download.
Here i have two questions,
1)Can i display the attachment files in my page?
2)I want to download the selected file from an attachment.suppose If i have an attachment with 5 files.
and i select the 3rd file then the 3rd file will be download.how can i do it?
1) Yes. How to do that is not a JavaMail problem.
2) Attachments don't have 5 files, but you might have 5 file attachments. If you want the third one, write a loop that finds all the attachments and stop when it finds the third one.
There are some demo programs included with JavaMail that might help you. Have you found them?