Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

Upload file on server using applet

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I need to create an applet for my web application.I have to make drag and drop functionality in applet.
I have created an applet where i make a functionality for email drag and drop from outlook and store that email on client machine. Its working fine but after creating a file i have to upload those file on my server.
I can not use servlet because my application is developed in mvc.

Can anyone help me how to upload file on server using applet and ASP.NET.

Below is my code for creating file on client machine

String libFile = System.getProperty("os.arch").equals("amd64") ? "jacob-1.18-M2-x64.dll" : "jacob-1.18-M2-x86.dll";
InputStream inputStream = new FileInputStream("C:\\OutlookConfig\\"+libFile);

File temporaryDll = File.createTempFile("jacob", ".dll");
FileOutputStream outputStream = new FileOutputStream(temporaryDll);
byte[] array = new byte[8192];
for (int i =; i != -1; i = {
outputStream.write(array, 0, i);

System.setProperty(LibraryLoader.JACOB_DLL_PATH, temporaryDll.getAbsolutePath());

txtArea.append("Creating message files....");

ActiveXComponent xl = new ActiveXComponent("Outlook.Application");
Dispatch explorer = Dispatch.get(xl,"ActiveExplorer").toDispatch();
Dispatch selection = Dispatch.get(explorer, "Selection").toDispatch();
Variant count = Dispatch.get(selection, "Count");

// loop over selected mail items.
for (int mailIndex = 1; mailIndex <= count.getInt(); mailIndex++ ) {
Integer[] k = new Integer[]{new Integer(mailIndex)};
Dispatch mailItem =, "Item", k).toDispatch();
// Variant subject = Dispatch.get(mailItem, "Subject");
String fileid = UUID.randomUUID().toString();
String[] save = new String[]{"C:\\OutlookConfig\\"+fileid+".msg"};

Variant saved =, "SaveAs",save);


I can't take it! You are too smart for me! Here is the tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic