commons-user mailing list archives

On 6/9/05, Schalk Neethling <schalk@volume4.com> wrote:
> Hey there everyone!
>
> Hope someone can give me an answer here. I am using the fileUpload
> package in one of my apps and have had some trouble getting the actual
> file name when the user is using IE. In IE the entire location string is
> sent by the browser instead of just the file name. Now, I have found a
> way to get past that, I thought, but now here is my problem.
>
> When testing the app on my local WindowsXP machine on both Firefox and
> IE it works perfectly, however, when I move this up to the server, Red
> Hat Linux, the file name written to disk when using IE is completely wrong.
>
> Here is the code I use to get the file name:
> if(item.getFieldName().equals("uploadPDF")) {
>
> File fullFile = new File(item.getName());
> uploadPDF = fullFile.getName();
> File savedFile = new File(serverFolder, uploadPDF);
> item.write(savedFile);
> }
>
> Any idea why this would return the file name differently depending on
> which platform the app runs. BTW, the files are uploaded using a
> WindowsXP machine and IE 6.0 as the client. Any ideas? Thanks!
I suspect that it's not the platform so much as the JVM. My guess is
that the File implementation on the JVM you're using on Red Hat is not
parsing the Windows path that's provided by IE as you are expecting it
to. You are assuming that File will parse both Windows and Unix paths.
I believe this is true on Sun JVMs, but not on some Linux JVMs.
--
Martin Cooper
> --
> Kind Regards
> Schalk Neethling
> Web Developer.Designer.Programmer.President
> Volume4.Business.Solution.Developers
> emotionalize.conceptualize.visualize.realize
> Landlines
> Tel: +27125468436
> Fax: +27125468436
> Web
> email:schalk@volume4.com
> Global: www.volume4.com
> Messenger
> Yahoo!: v_olume4
> AOL: v0lume4
> MSN: volume4_@hotmail.com
>
> We support OpenSource
> Get Firefox!- The browser reloaded - http://www.mozilla.org/products/firefox/
>
> This message contains information that is considered to be sensitive or confidential
and may not be forwarded or disclosed to any other party without the permission of the sender.
If you received this message in error, please notify me immediately so that I can correct
and delete the original email. Thank you.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org