*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);*
use this ..i guess i would be work fine .
http://java-malli.blogspot.com/search?updated-max=2010-04-08T03%3A53%3A00-07%3A00&max-results=7
Thanks,
Malli.
On Wed, Jun 16, 2010 at 3:54 AM, balachandra maddina
<[email protected]>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 [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-web-toolkit%[email protected]>
> .
> 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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.