try adding a statement upload.setName("<your form name>");
after creation of object for FileUpload.
--
Aditya


On Wed, Jun 16, 2010 at 1:24 PM, balachandra maddina
<chandu2...@gmail.com>wrote:

> Hi There,
>
>   Im trying a file upload using the below code but on my server side no
> file items are available but without changing the server code if i try using
> a plain html with a form then the server was able to see file items. please
> let me know if im missing anything here.
>
> GWT code:
> -----------------
>
>>   uploadForm = new FormPanel();
>>
>>       uploadForm.reset();
>>
>>       uploadForm.setAction("../upload");
>>
>>       uploadForm.setEncoding(FormPanel.ENCODING_MULTIPART);
>>
>>       uploadForm.setMethod(FormPanel.METHOD_POST);
>>
>>
>>>       FileUpload upload = new FileUpload();
>>
>>       uploadForm.add(upload);
>>
>>       uploadPanel.add(uploadForm);
>>
>>
> Server side code:
> -------------------------
>
>> String contentType = request.getContentType();
>
>       if (!ServletFileUpload.isMultipartContent(request)) {
>
>          return super.onSubmit(request, response, command, errors);
>
>       }
>
>       FileItemFactory factory = new DiskFileItemFactory();
>
>       ServletFileUpload upload = new ServletFileUpload(factory);
>
>       try {
>
>          List<FileItem> fileItems = upload.parseRequest(request);
>
>          if (null != fileItems && !fileItems.isEmpty()) {
>
>
>
> Your help is very much appreciated.
>
> Thank you,
> bala.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To post to this group, send email to google-web-tool...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-web-toolkit+unsubscr...@googlegroups.com<google-web-toolkit%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to