onsubmit complete called in windows but problem in linux

37 views
Skip to first unread message

aman

unread,
Aug 10, 2011, 7:26:42 AM8/10/11
to Google Web Toolkit
Hi,

I have created a file upload system which allows the user to
upload .txt,.xls and .csv formats.When I executed in windows it is
running fine but now when I deployed the application in linux(Debian)
using tomcat server I am facing this issue:

The onsubmit method is called for all the file formats.
onSubmitComplete method is called only when text files are uploaded.I
want to use onSubmitComplete event as I am using progress bar and
wanted to perform necessary action on this event.

Here is my code:

{
file = new FileUpload();
form = new FormPanel();
file.setName("file");
file.setTitle("select a file");

submit = new Button("Upload");
submit.setTitle("upload file");

form.setEncoding(FormPanel.ENCODING_MULTIPART);
form.setMethod(FormPanel.METHOD_POST);





submit.addClickHandler(this);
form.addSubmitHandler(this);
form.addSubmitCompleteHandler(this);
}


Please tell me why the same code is working fine in windows and not in
linux.


Thanks,

Amandeep

Jeff Chimene

unread,
Aug 10, 2011, 7:29:37 AM8/10/11
to google-we...@googlegroups.com
On 08/10/2011 04:26 AM, aman wrote:
> Hi,
>
> I have created a file upload system which allows the user to
> upload .txt,.xls and .csv formats.When I executed in windows it is
> running fine but now when I deployed the application in linux(Debian)
> using tomcat server I am facing this issue:
>
> The onsubmit method is called for all the file formats.
> onSubmitComplete method is called only when text files are uploaded.I
> want to use onSubmitComplete event as I am using progress bar and
> wanted to perform necessary action on this event.

Have you considered gwt-upload?

I think it works w/ Tomcat. I've had great luck with it cross-platform.

aman

unread,
Aug 10, 2011, 11:59:47 PM8/10/11
to Google Web Toolkit
Thanks for your reply,though I am not using gwt-upload but I tried
initially but it did not worked according to my expectations so now I
am using the simple FileUpload control.It is working well in windows
but not in linux can you suggest me some reason why this is happening
because at the moment I am completely unable to figure out a reason
why this is happening so.

On Aug 10, 4:29 pm, Jeff Chimene <jchim...@gmail.com> wrote:
> On 08/10/2011 04:26 AM, aman wrote:
>
> > Hi,
>
> > I have created a file upload system which allows the user to
> > upload .txt,.xls and .csv formats.When I executed in windows it is
> > running fine but now when I deployed the application inlinux(Debian)
> > using tomcat server I am facing this issue:
>
> > The onsubmit method is called for all the file formats.
> >onSubmitCompletemethod is called only when text files are uploaded.I
> > want to useonSubmitCompleteevent as I am using progress bar and

karim duran

unread,
Aug 11, 2011, 4:21:02 AM8/11/11
to google-we...@googlegroups.com
Hi Aman

I'm very surprised about your issue : "FileUpload works under Window not Linux".
It smells file READ/WRITE permission....
Have a reflection about this :

1) From point of view of client ( browser), an upload is no more than a HTTP form POST with <input type="file" ....../>. The browser let you choose a file from client local File System, with the standard OS OpenFile dialogbox according to RFC 1867. The client part is standard and don't depend upon your Operationg System and the browser you use e.g IE, Mozilla family, Opera, Apple SAFARI.
GWT client part upload capability don't transgress this standard, just wrap it in a friendly way.

Do you agree ?


2) The server part is the process receiving the POST HTTP, it can be a JAVA Servlet, a PHP script etc...THIS PROCESS HAVE AN OWNER FROM THE POINT OF VIEW OF OS READ/WRITE PERMISSION.
  • For this process you have to define the path where the file will be witten on the Server File System with a configuration directive.
  • If, let says, you define "C:\WebUploadFile\users\bob" it won't work under Linux, because Linux don't understand what is "C:\WebUploadFile" !!!! So, set the path according to your OS path syntax.
  • If you use Tomcat, on window, it works ! I agree. It could also works on window if you define the path like that /WebUploadFile/users/bob because JVM has an intelligent path syntax managment. So, prefer UNIX like path syntax.
  • Under Linux, the process generally has the same permission than the server itself. I mean TOMCAT/TOMCAT owner/group. If you upload a file, and try to writte it on, let says, /var/webupload/users/bob, you have to ensure that the TOMCAT/TOMCAT profil has permission to write in this directory !!!
  • On window, permissions are blurred, so as TOMCAT is installed as a service, may be it can write anywhere on Win filesystem.
Try to check these points, may be it's the problem. The same issue can appear on other J2EE server ( JBOSS, WebSphere, GlassFish...). It's not related to GWT.

I hope it helps.

Regards.

Karim Duran

2011/8/11 aman <bhatia...@gmail.com>

--
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-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.


Alex Dobjanschi

unread,
Aug 11, 2011, 6:13:35 AM8/11/11
to google-we...@googlegroups.com
What isn't working -- upload (you don't see the call), server processing, there isn't any response?
Reply all
Reply to author
Forward
0 new messages