You can use this code in your Action class after declaring a form element of type FormFile.
FormFile file = (FormFile) theForm.get("theFile") ; String fileName = file.getFileName() ; int fileSize = file.getFileSize() ; if ( (fileName != null) && (!fileName.equals("")) ) { try { if (fileSize != 0) { File xmlFile = new File(uploadAreaTemp + File.separator + fileName) ; FileOutputStream fos ; fos = new FileOutputStream(xmlFile) ; byte[] fileData = file.getFileData() ; fos.write(fileData) ; fos.close() ; } catch (Exception e) {} > -----Original Message----- > From: bhanu sistla [mailto:[EMAIL PROTECTED] > Sent: Wednesday, July 30, 2003 5:41 PM > To: [EMAIL PROTECTED] > Subject: Uploading a file to server using struts > > > Hi All, > > I have an urgent requirement. Has any body have the code how > to upload a file to server using struts frame work. > > Regards > Bhanu > > > --------------------------------- > Want to chat instantly with your online friends? Get the FREE > Yahoo!Messenger > **************************Disclaimer************************************ Information contained in this E-MAIL being proprietary to Wipro Limited is 'privileged' and 'confidential' and intended for use only by the individual or entity to which it is addressed. You are notified that any use, copying or dissemination of the information contained in the E-MAIL in any manner whatsoever is strictly prohibited. *************************************************************************** --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]