Hi,
 
This is the sample code I am using in the action.java file.I have the necessary struts 
file.But it says Unable to find ServletActionContext in MultipartRequestWrapper when 
compiled.
 
MultipartRequestWrapper multiWrapper =
            (MultipartRequestWrapper) 
ServletActionContext.getRequest();

Enumeration e = multiWrapper.getFileNames();
while(e.hasMoreElements()) {
   // get the value of thisinput tag
   StringinputValue = (String) e.nextElement();
// get the content type
   StringcontentType = multiWrapper.getContentType(inputValue);
// get the name of the file from the input tag
   StringfileName = multiWrapper.getFilesystemName(inputValue);
// Get a File object forthe uploaded File
   File file = multiWrapper.getFile(inputValue);
// If it's nullthe upload failed
   if(file == null) {
      addActionError("Error uploading: "+
multiWrapper.getFilesystemName(inputValue));
   }


David Friedman <[EMAIL PROTECTED]> wrote:
Why won't you use the struts-upload.war from the Struts distributions?

Regards,
David

-----Original Message-----
From: Jacob Ginu [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 23, 2003 9:48 PM
To: [EMAIL PROTECTED]
Subject: reg:File Upload

Hi,

Can anyone send me a sample file Upload program.

Regards,
Ginu

---------------------------------
Do you Yahoo!?
Yahoo! Photos - Get your photo on the big screen in Times Square


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------
Do you Yahoo!?
Yahoo! Photos - Get your photo on the big screen in Times Square

Reply via email to