Skip to Content
0
Former Member
Nov 26, 2004 at 10:36 AM

File Upload Problem

57 Views

Hi,

I am trying to upload a file and it is not uploading. I ported the application in J2EE WAS SP7. If i port the application in j2ee+abap WAS SP7 ,the application is working fine. Why upload app is not working in j2ee based WAS?.Below is the code.

<i>

//@@begin onActionSubmit(ServerEvent)

String location = "c:
temp
";

//reingeschraubt!!!

// String fileName = "c:
temp
upload
" + wdContext.currentRootElement().getFileName();

String fileName = location + wdContext.currentRootElement().getFileName();

try{

File file = new File(fileName);

FileOutputStream out = new FileOutputStream(file);

IPrivateView1.IRootElement element = wdContext.currentRootElement();

out.write(element.getFile());

out.close();

}catch(Exception e){

throw new WDRuntimeException(e);

}

wdContext.currentRootElement().setFileName("");

wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("File " + fileName + " wurde gesichert!");

//@@end

</i>

Thanks in Advance..

Regards

Vasu