[fileUpload] Question about file name

classic Classic list List threaded Threaded
19 messages Options
Reply | Threaded
Open this post in threaded view
|

[fileUpload] Question about file name

Volume4
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!

--
Kind Regards
Schalk Neethling
Web Developer.Designer.Programmer.President
Volume4.Business.Solution.Developers
emotionalize.conceptualize.visualize.realize
Landlines
Tel: +27125468436
Fax: +27125468436
Web
email:[hidden email]
Global: www.volume4.com
Messenger
Yahoo!: v_olume4
AOL: v0lume4
MSN: [hidden email]

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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [fileUpload] Question about file name

Martin Cooper
On 6/9/05, Schalk Neethling <[hidden email]> 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:[hidden email]
> Global: www.volume4.com
> Messenger
> Yahoo!: v_olume4
> AOL: v0lume4
> MSN: [hidden email]
>
> 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: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [fileUpload] Question about file name

Volume4
Martin

Thanks for the reply. Do you have a suggestion as to better code to
handle getting the filename? I have used both a StringTokenizer as well
as String.split but was not able to get to just the filename. Any
suggestions or pointers? Thank you!

Martin Cooper wrote:

>On 6/9/05, Schalk Neethling <[hidden email]> 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:[hidden email]
>>Global: www.volume4.com
>>Messenger
>>Yahoo!: v_olume4
>>AOL: v0lume4
>>MSN: [hidden email]
>>
>>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: [hidden email]
>>For additional commands, e-mail: [hidden email]
>>
>>
>>    
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [hidden email]
>For additional commands, e-mail: [hidden email]
>
>
>
>
>  
>

--
Kind Regards
Schalk Neethling
Web Developer.Designer.Programmer.President
Volume4.Business.Solution.Developers
emotionalize.conceptualize.visualize.realize
Landlines
Tel: +27125468436
Fax: +27125468436
Web
email:[hidden email]
Global: www.volume4.com
Messenger
Yahoo!: v_olume4
AOL: v0lume4
MSN: [hidden email]

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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [fileUpload] Question about file name

Volume4
In reply to this post by Martin Cooper
If anyone experiences this same problem here is the solution:

Instead of:

File fullFile  = new File(item.getName());
uploadPDF = fullFile.getName();
File savedFile = new File(serverFolder, uploadPDF);
item.write(savedFile);

Use:

int i = item.getName().lastIndexOf('\\');
uploadPDF = item.getName().substring(i+1);
File savedFile = new File(serverFolder, item.getName().substring(i+1) );
item.write(savedFile);



Martin Cooper wrote:

>On 6/9/05, Schalk Neethling <[hidden email]> 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:[hidden email]
>>Global: www.volume4.com
>>Messenger
>>Yahoo!: v_olume4
>>AOL: v0lume4
>>MSN: [hidden email]
>>
>>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: [hidden email]
>>For additional commands, e-mail: [hidden email]
>>
>>
>>    
>>
>
>
>
>  
>

--
Kind Regards
Schalk Neethling
Web Developer.Designer.Programmer.President
Volume4.Business.Solution.Developers
emotionalize.conceptualize.visualize.realize
Landlines
Tel: +27125468436
Fax: +27125468436
Web
email:[hidden email]
Global: www.volume4.com
Messenger
Yahoo!: v_olume4
AOL: v0lume4
MSN: [hidden email]

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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: [fileUpload] Question about file name

William Noto-2
Won't you still have an OS dependency in there with that \\?  

I think you can use File.pathSeperatorChar to handle that.

William B. Noto    Open Finance    71 Gansevoort Street, Suite 2D, New York,
NY 10014
Tel  + 1 646 230 8666     Fax  + 1 646 230 8657    [hidden email]


-----Original Message-----
From: Schalk Neethling [mailto:[hidden email]]
Sent: Thursday, June 09, 2005 3:48 PM
To: Martin Cooper
Cc: Jakarta Commons Users List
Subject: Re: [fileUpload] Question about file name

If anyone experiences this same problem here is the solution:

Instead of:

File fullFile  = new File(item.getName());
uploadPDF = fullFile.getName();
File savedFile = new File(serverFolder, uploadPDF);
item.write(savedFile);

Use:

int i = item.getName().lastIndexOf('\\');
uploadPDF = item.getName().substring(i+1);
File savedFile = new File(serverFolder, item.getName().substring(i+1) );
item.write(savedFile);



Martin Cooper wrote:

>On 6/9/05, Schalk Neethling <[hidden email]> 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:[hidden email]
>>Global: www.volume4.com
>>Messenger
>>Yahoo!: v_olume4
>>AOL: v0lume4
>>MSN: [hidden email]
>>
>>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: [hidden email]
>>For additional commands, e-mail: [hidden email]
>>
>>
>>    
>>
>
>
>
>  
>

--
Kind Regards
Schalk Neethling
Web Developer.Designer.Programmer.President
Volume4.Business.Solution.Developers
emotionalize.conceptualize.visualize.realize
Landlines
Tel: +27125468436
Fax: +27125468436
Web
email:[hidden email]
Global: www.volume4.com
Messenger
Yahoo!: v_olume4
AOL: v0lume4
MSN: [hidden email]

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: [hidden email]
For additional commands, e-mail: [hidden email]




---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: [fileUpload] Question about file name

James Sangster
In reply to this post by Volume4
You could try doing a String.lastIndexOf( File.pathSeperatorChar ) to get
the last occurrence of the separator, and then do a substr using that index
to get the file name itself.

james


-----Original Message-----
From: Schalk Neethling [mailto:[hidden email]]
Sent: Thursday, June 09, 2005 3:07 PM
To: Jakarta Commons Users List
Subject: Re: [fileUpload] Question about file name


Martin

Thanks for the reply. Do you have a suggestion as to better code to
handle getting the filename? I have used both a StringTokenizer as well
as String.split but was not able to get to just the filename. Any
suggestions or pointers? Thank you!

Martin Cooper wrote:

>On 6/9/05, Schalk Neethling <[hidden email]> 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:[hidden email]
>>Global: www.volume4.com
>>Messenger
>>Yahoo!: v_olume4
>>AOL: v0lume4
>>MSN: [hidden email]
>>
>>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: [hidden email]
>>For additional commands, e-mail: [hidden email]
>>
>>
>>    
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [hidden email]
>For additional commands, e-mail: [hidden email]
>
>
>
>
>  
>

--
Kind Regards
Schalk Neethling
Web Developer.Designer.Programmer.President
Volume4.Business.Solution.Developers
emotionalize.conceptualize.visualize.realize
Landlines
Tel: +27125468436
Fax: +27125468436
Web
email:[hidden email]
Global: www.volume4.com
Messenger
Yahoo!: v_olume4
AOL: v0lume4
MSN: [hidden email]

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: [hidden email]
For additional commands, e-mail: [hidden email]


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [fileUpload] Question about file name

Volume4
Thanks everyone, I will surely find a cross OS solution combining all of
these.

James Sangster wrote:

>You could try doing a String.lastIndexOf( File.pathSeperatorChar ) to get
>the last occurrence of the separator, and then do a substr using that index
>to get the file name itself.
>
>james
>
>
>-----Original Message-----
>From: Schalk Neethling [mailto:[hidden email]]
>Sent: Thursday, June 09, 2005 3:07 PM
>To: Jakarta Commons Users List
>Subject: Re: [fileUpload] Question about file name
>
>
>Martin
>
>Thanks for the reply. Do you have a suggestion as to better code to
>handle getting the filename? I have used both a StringTokenizer as well
>as String.split but was not able to get to just the filename. Any
>suggestions or pointers? Thank you!
>
>Martin Cooper wrote:
>
>  
>
>>On 6/9/05, Schalk Neethling <[hidden email]> 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:[hidden email]
>>>Global: www.volume4.com
>>>Messenger
>>>Yahoo!: v_olume4
>>>AOL: v0lume4
>>>MSN: [hidden email]
>>>
>>>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: [hidden email]
>>>For additional commands, e-mail: [hidden email]
>>>
>>>
>>>  
>>>
>>>      
>>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: [hidden email]
>>For additional commands, e-mail: [hidden email]
>>
>>
>>
>>
>>
>>
>>    
>>
>
>  
>

--
Kind Regards
Schalk Neethling
Web Developer.Designer.Programmer.President
Volume4.Business.Solution.Developers
emotionalize.conceptualize.visualize.realize
Landlines
Tel: +27125468436
Fax: +27125468436
Web
email:[hidden email]
Global: www.volume4.com
Messenger
Yahoo!: v_olume4
AOL: v0lume4
MSN: [hidden email]

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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [fileUpload] Question about file name

Martin Cooper
In reply to this post by William Noto-2
On 6/9/05, William Noto <[hidden email]> wrote:
> Won't you still have an OS dependency in there with that \\?

Yes, it would be OS dependent. However, IE is the only browser (that
I'm aware of) that sends the full path, so that probably doesn't
matter. (Not sure what IE on Mac does, but it's broken in plenty of
other ways too.)

> I think you can use File.pathSeperatorChar to handle that.

Nope. If the upload came from a Windows system and the server is
running on *nix, then the system separator is *not* what you want.
You'd be looking for '/' in a path that uses '\' as the separator.

--
Martin Cooper


> William B. Noto    Open Finance    71 Gansevoort Street, Suite 2D, New York,
> NY 10014
> Tel  + 1 646 230 8666     Fax  + 1 646 230 8657    [hidden email]
>
>
> -----Original Message-----
> From: Schalk Neethling [mailto:[hidden email]]
> Sent: Thursday, June 09, 2005 3:48 PM
> To: Martin Cooper
> Cc: Jakarta Commons Users List
> Subject: Re: [fileUpload] Question about file name
>
> If anyone experiences this same problem here is the solution:
>
> Instead of:
>
> File fullFile  = new File(item.getName());
> uploadPDF = fullFile.getName();
> File savedFile = new File(serverFolder, uploadPDF);
> item.write(savedFile);
>
> Use:
>
> int i = item.getName().lastIndexOf('\\');
> uploadPDF = item.getName().substring(i+1);
> File savedFile = new File(serverFolder, item.getName().substring(i+1) );
> item.write(savedFile);
>
>
>
> Martin Cooper wrote:
>
> >On 6/9/05, Schalk Neethling <[hidden email]> 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:[hidden email]
> >>Global: www.volume4.com
> >>Messenger
> >>Yahoo!: v_olume4
> >>AOL: v0lume4
> >>MSN: [hidden email]
> >>
> >>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: [hidden email]
> >>For additional commands, e-mail: [hidden email]
> >>
> >>
> >>
> >>
> >
> >
> >
> >
> >
>
> --
> Kind Regards
> Schalk Neethling
> Web Developer.Designer.Programmer.President
> Volume4.Business.Solution.Developers
> emotionalize.conceptualize.visualize.realize
> Landlines
> Tel: +27125468436
> Fax: +27125468436
> Web
> email:[hidden email]
> Global: www.volume4.com
> Messenger
> Yahoo!: v_olume4
> AOL: v0lume4
> MSN: [hidden email]
>
> 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: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

new GUI techenologies

Mathew, Manoj
In reply to this post by Volume4
Hi

  My company is using applets,xml, xsl and one transformation engine to generate html pages. They are discussing about going for some enw techenologies to develop more impressive GUI.
Gurus what you guys think about the best one to go for? Pelase keep in mind thta this si a financal company. So they don't want that flashy ones..


Toplink???

thanks
Matt


-----Message Disclaimer-----

This e-mail message is intended only for the use of the individual or
entity to which it is addressed, and may contain information that is
privileged, confidential and exempt from disclosure under applicable law.
If you are not the intended recipient, any dissemination, distribution or
copying of this communication is strictly prohibited. If you have
received this communication in error, please notify us immediately by
reply email to [hidden email] and delete or destroy all copies of
the original message and attachments thereto. Email sent to or from the
Principal Financial Group or any of its member companies may be retained
as required by law or regulation.

Nothing in this message is intended to constitute an Electronic signature
for purposes of the Uniform Electronic Transactions Act (UETA) or the
Electronic Signatures in Global and National Commerce Act ("E-Sign")
unless a specific statement to the contrary is included in this message.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: [fileUpload] Question about file name

William Noto-2
In reply to this post by Martin Cooper
Oh right - duh.

FWIW: I'm doing similar file uploading stuff on my project but I'm using
org.apache.struts.upload.FormFile which has a getFileName() method that
always gives me just the file's name without any of the path hoohah.  I
don't know if using this object requires using struts (or if that would be a
problem for you) but I found it very easy to use.

William B. Noto    Open Finance    71 Gansevoort Street, Suite 2D, New York,
NY 10014
Tel  + 1 646 230 8666     Fax  + 1 646 230 8657    [hidden email]


-----Original Message-----
From: Martin Cooper [mailto:[hidden email]]
Sent: Thursday, June 09, 2005 4:36 PM
To: William Noto
Cc: Jakarta Commons Users List; [hidden email]
Subject: Re: [fileUpload] Question about file name

On 6/9/05, William Noto <[hidden email]> wrote:
> Won't you still have an OS dependency in there with that \\?

Yes, it would be OS dependent. However, IE is the only browser (that
I'm aware of) that sends the full path, so that probably doesn't
matter. (Not sure what IE on Mac does, but it's broken in plenty of
other ways too.)

> I think you can use File.pathSeperatorChar to handle that.

Nope. If the upload came from a Windows system and the server is
running on *nix, then the system separator is *not* what you want.
You'd be looking for '/' in a path that uses '\' as the separator.

--
Martin Cooper


> William B. Noto    Open Finance    71 Gansevoort Street, Suite 2D, New
York,

> NY 10014
> Tel  + 1 646 230 8666     Fax  + 1 646 230 8657    [hidden email]
>
>
> -----Original Message-----
> From: Schalk Neethling [mailto:[hidden email]]
> Sent: Thursday, June 09, 2005 3:48 PM
> To: Martin Cooper
> Cc: Jakarta Commons Users List
> Subject: Re: [fileUpload] Question about file name
>
> If anyone experiences this same problem here is the solution:
>
> Instead of:
>
> File fullFile  = new File(item.getName());
> uploadPDF = fullFile.getName();
> File savedFile = new File(serverFolder, uploadPDF);
> item.write(savedFile);
>
> Use:
>
> int i = item.getName().lastIndexOf('\\');
> uploadPDF = item.getName().substring(i+1);
> File savedFile = new File(serverFolder, item.getName().substring(i+1) );
> item.write(savedFile);
>
>
>
> Martin Cooper wrote:
>
> >On 6/9/05, Schalk Neethling <[hidden email]> 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:[hidden email]
> >>Global: www.volume4.com
> >>Messenger
> >>Yahoo!: v_olume4
> >>AOL: v0lume4
> >>MSN: [hidden email]
> >>
> >>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: [hidden email]
> >>For additional commands, e-mail: [hidden email]
> >>
> >>
> >>
> >>
> >
> >
> >
> >
> >
>
> --
> Kind Regards
> Schalk Neethling
> Web Developer.Designer.Programmer.President
> Volume4.Business.Solution.Developers
> emotionalize.conceptualize.visualize.realize
> Landlines
> Tel: +27125468436
> Fax: +27125468436
> Web
> email:[hidden email]
> Global: www.volume4.com
> Messenger
> Yahoo!: v_olume4
> AOL: v0lume4
> MSN: [hidden email]
>
> 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: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]




---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [fileUpload] Question about file name

Frank W. Zammetti
In reply to this post by Martin Cooper
On Thu, June 9, 2005 4:35 pm, Martin Cooper said:
> Nope. If the upload came from a Windows system and the server is
> running on *nix, then the system separator is *not* what you want.
> You'd be looking for '/' in a path that uses '\' as the separator.

Good point.

OK, so thinking simplistically..

    final char PATH_SEP = File.pathSeparatorChar;
    final char ANTI_PATH_SEP = File.pathSeparatorChar == '/' ? '\\' : '/';
    String test = "/sub/dev/test.txt";
    int lastSep;
    lastSep = test.lastIndexOf(PATH_SEP);
    if (lastSep == -1) {
      lastSep = test.lastIndexOf(ANTI_PATH_SEP);
    }

Should do the trick, no?

> Martin Cooper

--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: new GUI techenologies

Stavros Kounis
In reply to this post by Mathew, Manoj
On 6/9/05, Mathew, Manoj <[hidden email]> wrote:

> Hi
>
>   My company is using applets,xml, xsl and one transformation engine to generate html pages. They are discussing about going for some enw techenologies to develop more impressive GUI.
> Gurus what you guys think about the best one to go for? Pelase keep in mind thta this si a financal company. So they don't want that flashy ones..
>
>
> Toplink???
>
> thanks
> Matt

hi matt

if you want to keep the web based approach take a look at cocoon
framework [1]. It's a very powerfull xml/xsl publishing machine.
Inside it live a very good web-form framework (Cocoon Forms)

[1] http://cocoon.apache.org

>
>
> -----Message Disclaimer-----
>
> This e-mail message is intended only for the use of the individual or
> entity to which it is addressed, and may contain information that is
> privileged, confidential and exempt from disclosure under applicable law.
> If you are not the intended recipient, any dissemination, distribution or
> copying of this communication is strictly prohibited. If you have
> received this communication in error, please notify us immediately by
> reply email to [hidden email] and delete or destroy all copies of
> the original message and attachments thereto. Email sent to or from the
> Principal Financial Group or any of its member companies may be retained
> as required by law or regulation.
>
> Nothing in this message is intended to constitute an Electronic signature
> for purposes of the Uniform Electronic Transactions Act (UETA) or the
> Electronic Signatures in Global and National Commerce Act ("E-Sign")
> unless a specific statement to the contrary is included in this message.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
Stavros Kounis                        Osmosis networks & consulting
http://tools.osmosis.gr/blog          http://www.osmosis.gr

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: new GUI technologies

Mathew, Manoj
In reply to this post by Mathew, Manoj
Hi
 How about the richness of cocoon? One of the main reason we are thinking about new technologies is we want to have more impressive web pages. WE are even considering going for web sphere portals. So now you would have understood what really need. Please throw some lights. I have done a project with jsp/struts. But I couldn't find it much rich.

-----Original Message-----
From: Stavros Kounis [mailto:[hidden email]]
Sent: Thursday, June 09, 2005 3:47 PM
To: Jakarta Commons Users List
Subject: Re: new GUI techenologies


On 6/9/05, Mathew, Manoj <[hidden email]> wrote:

> Hi
>
>   My company is using applets,xml, xsl and one transformation engine to generate html pages. They are discussing about going for some enw techenologies to develop more impressive GUI.
> Gurus what you guys think about the best one to go for? Pelase keep in mind thta this si a financal company. So they don't want that flashy ones..
>
>
> Toplink???
>
> thanks
> Matt

hi matt

if you want to keep the web based approach take a look at cocoon
framework [1]. It's a very powerfull xml/xsl publishing machine.
Inside it live a very good web-form framework (Cocoon Forms)

[1] http://cocoon.apache.org

>
>
> -----Message Disclaimer-----
>
> This e-mail message is intended only for the use of the individual or
> entity to which it is addressed, and may contain information that is
> privileged, confidential and exempt from disclosure under applicable law.
> If you are not the intended recipient, any dissemination, distribution or
> copying of this communication is strictly prohibited. If you have
> received this communication in error, please notify us immediately by
> reply email to [hidden email] and delete or destroy all copies of
> the original message and attachments thereto. Email sent to or from the
> Principal Financial Group or any of its member companies may be retained
> as required by law or regulation.
>
> Nothing in this message is intended to constitute an Electronic signature
> for purposes of the Uniform Electronic Transactions Act (UETA) or the
> Electronic Signatures in Global and National Commerce Act ("E-Sign")
> unless a specific statement to the contrary is included in this message.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
Stavros Kounis                        Osmosis networks & consulting
http://tools.osmosis.gr/blog          http://www.osmosis.gr

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]


-----Message Disclaimer-----

This e-mail message is intended only for the use of the individual or
entity to which it is addressed, and may contain information that is
privileged, confidential and exempt from disclosure under applicable law.
If you are not the intended recipient, any dissemination, distribution or
copying of this communication is strictly prohibited. If you have
received this communication in error, please notify us immediately by
reply email to [hidden email] and delete or destroy all copies of
the original message and attachments thereto. Email sent to or from the
Principal Financial Group or any of its member companies may be retained
as required by law or regulation.

Nothing in this message is intended to constitute an Electronic signature
for purposes of the Uniform Electronic Transactions Act (UETA) or the
Electronic Signatures in Global and National Commerce Act ("E-Sign")
unless a specific statement to the contrary is included in this message.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [fileUpload] Question about file name

Volume4
In reply to this post by Martin Cooper
Thanks Martin

Martin Cooper wrote:

>On 6/9/05, William Noto <[hidden email]> wrote:
>  
>
>>Won't you still have an OS dependency in there with that \\?
>>    
>>
>
>Yes, it would be OS dependent. However, IE is the only browser (that
>I'm aware of) that sends the full path, so that probably doesn't
>matter. (Not sure what IE on Mac does, but it's broken in plenty of
>other ways too.)
>
>  
>
>>I think you can use File.pathSeperatorChar to handle that.
>>    
>>
>
>Nope. If the upload came from a Windows system and the server is
>running on *nix, then the system separator is *not* what you want.
>You'd be looking for '/' in a path that uses '\' as the separator.
>
>--
>Martin Cooper
>
>
>  
>
>>William B. Noto    Open Finance    71 Gansevoort Street, Suite 2D, New York,
>>NY 10014
>>Tel  + 1 646 230 8666     Fax  + 1 646 230 8657    [hidden email]
>>
>>
>>-----Original Message-----
>>From: Schalk Neethling [mailto:[hidden email]]
>>Sent: Thursday, June 09, 2005 3:48 PM
>>To: Martin Cooper
>>Cc: Jakarta Commons Users List
>>Subject: Re: [fileUpload] Question about file name
>>
>>If anyone experiences this same problem here is the solution:
>>
>>Instead of:
>>
>>File fullFile  = new File(item.getName());
>>uploadPDF = fullFile.getName();
>>File savedFile = new File(serverFolder, uploadPDF);
>>item.write(savedFile);
>>
>>Use:
>>
>>int i = item.getName().lastIndexOf('\\');
>>uploadPDF = item.getName().substring(i+1);
>>File savedFile = new File(serverFolder, item.getName().substring(i+1) );
>>item.write(savedFile);
>>
>>
>>
>>Martin Cooper wrote:
>>
>>    
>>
>>>On 6/9/05, Schalk Neethling <[hidden email]> 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:[hidden email]
>>>>Global: www.volume4.com
>>>>Messenger
>>>>Yahoo!: v_olume4
>>>>AOL: v0lume4
>>>>MSN: [hidden email]
>>>>
>>>>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: [hidden email]
>>>>For additional commands, e-mail: [hidden email]
>>>>
>>>>
>>>>
>>>>
>>>>        
>>>>
>>>
>>>
>>>
>>>      
>>>
>>--
>>Kind Regards
>>Schalk Neethling
>>Web Developer.Designer.Programmer.President
>>Volume4.Business.Solution.Developers
>>emotionalize.conceptualize.visualize.realize
>>Landlines
>>Tel: +27125468436
>>Fax: +27125468436
>>Web
>>email:[hidden email]
>>Global: www.volume4.com
>>Messenger
>>Yahoo!: v_olume4
>>AOL: v0lume4
>>MSN: [hidden email]
>>
>>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: [hidden email]
>>For additional commands, e-mail: [hidden email]
>>
>>
>>
>>
>>    
>>
>
>
>
>  
>

--
Kind Regards
Schalk Neethling
Web Developer.Designer.Programmer.President
Volume4.Business.Solution.Developers
emotionalize.conceptualize.visualize.realize
Landlines
Tel: +27125468436
Fax: +27125468436
Web
email:[hidden email]
Global: www.volume4.com
Messenger
Yahoo!: v_olume4
AOL: v0lume4
MSN: [hidden email]

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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [fileUpload] Question about file name

Volume4
In reply to this post by William Noto-2
Thanks William. Small app this so I did not use struts but just the jar.

William Noto wrote:

>Oh right - duh.
>
>FWIW: I'm doing similar file uploading stuff on my project but I'm using
>org.apache.struts.upload.FormFile which has a getFileName() method that
>always gives me just the file's name without any of the path hoohah.  I
>don't know if using this object requires using struts (or if that would be a
>problem for you) but I found it very easy to use.
>
>William B. Noto    Open Finance    71 Gansevoort Street, Suite 2D, New York,
>NY 10014
>Tel  + 1 646 230 8666     Fax  + 1 646 230 8657    [hidden email]
>
>
>-----Original Message-----
>From: Martin Cooper [mailto:[hidden email]]
>Sent: Thursday, June 09, 2005 4:36 PM
>To: William Noto
>Cc: Jakarta Commons Users List; [hidden email]
>Subject: Re: [fileUpload] Question about file name
>
>On 6/9/05, William Noto <[hidden email]> wrote:
>  
>
>>Won't you still have an OS dependency in there with that \\?
>>    
>>
>
>Yes, it would be OS dependent. However, IE is the only browser (that
>I'm aware of) that sends the full path, so that probably doesn't
>matter. (Not sure what IE on Mac does, but it's broken in plenty of
>other ways too.)
>
>  
>
>>I think you can use File.pathSeperatorChar to handle that.
>>    
>>
>
>Nope. If the upload came from a Windows system and the server is
>running on *nix, then the system separator is *not* what you want.
>You'd be looking for '/' in a path that uses '\' as the separator.
>
>--
>Martin Cooper
>
>
>  
>
>>William B. Noto    Open Finance    71 Gansevoort Street, Suite 2D, New
>>    
>>
>York,
>  
>
>>NY 10014
>>Tel  + 1 646 230 8666     Fax  + 1 646 230 8657    [hidden email]
>>
>>
>>-----Original Message-----
>>From: Schalk Neethling [mailto:[hidden email]]
>>Sent: Thursday, June 09, 2005 3:48 PM
>>To: Martin Cooper
>>Cc: Jakarta Commons Users List
>>Subject: Re: [fileUpload] Question about file name
>>
>>If anyone experiences this same problem here is the solution:
>>
>>Instead of:
>>
>>File fullFile  = new File(item.getName());
>>uploadPDF = fullFile.getName();
>>File savedFile = new File(serverFolder, uploadPDF);
>>item.write(savedFile);
>>
>>Use:
>>
>>int i = item.getName().lastIndexOf('\\');
>>uploadPDF = item.getName().substring(i+1);
>>File savedFile = new File(serverFolder, item.getName().substring(i+1) );
>>item.write(savedFile);
>>
>>
>>
>>Martin Cooper wrote:
>>
>>    
>>
>>>On 6/9/05, Schalk Neethling <[hidden email]> 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:[hidden email]
>>>>Global: www.volume4.com
>>>>Messenger
>>>>Yahoo!: v_olume4
>>>>AOL: v0lume4
>>>>MSN: [hidden email]
>>>>
>>>>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: [hidden email]
>>>>For additional commands, e-mail: [hidden email]
>>>>
>>>>
>>>>
>>>>
>>>>        
>>>>
>>>
>>>
>>>
>>>      
>>>
>>--
>>Kind Regards
>>Schalk Neethling
>>Web Developer.Designer.Programmer.President
>>Volume4.Business.Solution.Developers
>>emotionalize.conceptualize.visualize.realize
>>Landlines
>>Tel: +27125468436
>>Fax: +27125468436
>>Web
>>email:[hidden email]
>>Global: www.volume4.com
>>Messenger
>>Yahoo!: v_olume4
>>AOL: v0lume4
>>MSN: [hidden email]
>>
>>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: [hidden email]
>>For additional commands, e-mail: [hidden email]
>>
>>
>>
>>
>>    
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [hidden email]
>For additional commands, e-mail: [hidden email]
>
>
>
>
>
>  
>

--
Kind Regards
Schalk Neethling
Web Developer.Designer.Programmer.President
Volume4.Business.Solution.Developers
emotionalize.conceptualize.visualize.realize
Landlines
Tel: +27125468436
Fax: +27125468436
Web
email:[hidden email]
Global: www.volume4.com
Messenger
Yahoo!: v_olume4
AOL: v0lume4
MSN: [hidden email]

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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [fileUpload] Question about file name

Knezevic, Mihael
In reply to this post by Frank W. Zammetti
this whole discussion is old. it can be found in the archives. the
implementation of the jvm on linux FROM SUN is faulty on this one. cause when
use use a filename like /tmp/mydir/myfile.txt and make a file object of it on
a windows system and get the name you would get the name myfile.txt though
the file separator on windows is a backslash, thats ok. but on linux you
won't get the name from a windows path. i send a bug report to sun. there was
some misunderstanding and then Dakota Jack <dakota.jack (at) gmail.com> send
also a bug report to sun. perhaps it is in the bug list by now.

and yes the ie sends the full path. call it a bug or a feature.

just replacing the backslash with a slash won't solve every case but most
cases.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: new GUI technologies

Leandro Saad
In reply to this post by Mathew, Manoj
Hi Matt. You have two choices: DHTML or Flash.
If you don't want to go with flash, I suggest you to take a look at the
new DHTML functionality available today. You can do pretty good things
with javascript + CSS.

Take a look at RICO
http://openrico.org/home.page
 
Here is a collection of AJAX links that I have:
http://del.icio.us/leandro.saad/ajax

Cheers!


On Thu, 2005-06-09 at 15:51 -0500, Mathew, Manoj wrote:

> Hi
>  How about the richness of cocoon? One of the main reason we are thinking about new technologies is we want to have more impressive web pages. WE are even considering going for web sphere portals. So now you would have understood what really need. Please throw some lights. I have done a project with jsp/struts. But I couldn't find it much rich.
>
> -----Original Message-----
> From: Stavros Kounis [mailto:[hidden email]]
> Sent: Thursday, June 09, 2005 3:47 PM
> To: Jakarta Commons Users List
> Subject: Re: new GUI techenologies
>
>
> On 6/9/05, Mathew, Manoj <[hidden email]> wrote:
> > Hi
> >
> >   My company is using applets,xml, xsl and one transformation engine to generate html pages. They are discussing about going for some enw techenologies to develop more impressive GUI.
> > Gurus what you guys think about the best one to go for? Pelase keep in mind thta this si a financal company. So they don't want that flashy ones..
> >
> >
> > Toplink???
> >
> > thanks
> > Matt
>
> hi matt
>
> if you want to keep the web based approach take a look at cocoon
> framework [1]. It's a very powerfull xml/xsl publishing machine.
> Inside it live a very good web-form framework (Cocoon Forms)
>
> [1] http://cocoon.apache.org
>
> >
> >
> > -----Message Disclaimer-----
> >
> > This e-mail message is intended only for the use of the individual or
> > entity to which it is addressed, and may contain information that is
> > privileged, confidential and exempt from disclosure under applicable law.
> > If you are not the intended recipient, any dissemination, distribution or
> > copying of this communication is strictly prohibited. If you have
> > received this communication in error, please notify us immediately by
> > reply email to [hidden email] and delete or destroy all copies of
> > the original message and attachments thereto. Email sent to or from the
> > Principal Financial Group or any of its member companies may be retained
> > as required by law or regulation.
> >
> > Nothing in this message is intended to constitute an Electronic signature
> > for purposes of the Uniform Electronic Transactions Act (UETA) or the
> > Electronic Signatures in Global and National Commerce Act ("E-Sign")
> > unless a specific statement to the contrary is included in this message.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [fileUpload] Question about file name

Dakota Jack
In reply to this post by Knezevic, Mihael
Yup:

Frank,

If the File class does not normalize the string used to create the
File, then there is a bug.  There seems to be a bug in one version of
Linux and that has been reported to Sun.  The constructor for File is
as follows:


   public File(String pathname) {
       if (pathname == null) {
           throw new NullPointerException();
       }
       this.path = fs.normalize(pathname);
       this.prefixLength = fs.prefixLength(this.path);
   }

Notice that an object fs is called to normalize the pathname.  The
object fs is created as a static field in all File classes as follows:


   static private FileSystem fs = FileSystem.getFileSystem();

The FileSystem class is an abstract class that has to be implemented,
of course, for the os on which it exists.  So, the basis for the class
is a JNI method:

   public static native FileSystem getFileSystem();

Sun did not go to all this trouble without expecting the actual
separators to be normalized to whatever system a file is created on,
so that no matter what your path happens to be in creating a File
object, file.getName() should return the name without a file
separator.  Is this helpful?

On 6/9/05, Mihael Knezevic <[hidden email]> wrote:

> this whole discussion is old. it can be found in the archives. the
> implementation of the jvm on linux FROM SUN is faulty on this one. cause when
> use use a filename like /tmp/mydir/myfile.txt and make a file object of it on
> a windows system and get the name you would get the name myfile.txt though
> the file separator on windows is a backslash, thats ok. but on linux you
> won't get the name from a windows path. i send a bug report to sun. there was
> some misunderstanding and then Dakota Jack <dakota.jack (at) gmail.com> send
> also a bug report to sun. perhaps it is in the bug list by now.
>
> and yes the ie sends the full path. call it a bug or a feature.
>
> just replacing the backslash with a slash won't solve every case but most
> cases.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [fileUpload] Question about file name

Volume4
I will definitely try this out, thank you.

Dakota Jack wrote:

>Yup:
>
>Frank,
>
>If the File class does not normalize the string used to create the
>File, then there is a bug.  There seems to be a bug in one version of
>Linux and that has been reported to Sun.  The constructor for File is
>as follows:
>
>
>   public File(String pathname) {
>       if (pathname == null) {
>           throw new NullPointerException();
>       }
>       this.path = fs.normalize(pathname);
>       this.prefixLength = fs.prefixLength(this.path);
>   }
>
>Notice that an object fs is called to normalize the pathname.  The
>object fs is created as a static field in all File classes as follows:
>
>
>   static private FileSystem fs = FileSystem.getFileSystem();
>
>The FileSystem class is an abstract class that has to be implemented,
>of course, for the os on which it exists.  So, the basis for the class
>is a JNI method:
>
>   public static native FileSystem getFileSystem();
>
>Sun did not go to all this trouble without expecting the actual
>separators to be normalized to whatever system a file is created on,
>so that no matter what your path happens to be in creating a File
>object, file.getName() should return the name without a file
>separator.  Is this helpful?
>
>On 6/9/05, Mihael Knezevic <[hidden email]> wrote:
>  
>
>>this whole discussion is old. it can be found in the archives. the
>>implementation of the jvm on linux FROM SUN is faulty on this one. cause when
>>use use a filename like /tmp/mydir/myfile.txt and make a file object of it on
>>a windows system and get the name you would get the name myfile.txt though
>>the file separator on windows is a backslash, thats ok. but on linux you
>>won't get the name from a windows path. i send a bug report to sun. there was
>>some misunderstanding and then Dakota Jack <dakota.jack (at) gmail.com> send
>>also a bug report to sun. perhaps it is in the bug list by now.
>>
>>and yes the ie sends the full path. call it a bug or a feature.
>>
>>just replacing the backslash with a slash won't solve every case but most
>>cases.
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: [hidden email]
>>For additional commands, e-mail: [hidden email]
>>
>>
>>    
>>
>
>
>  
>

--
Kind Regards
Schalk Neethling
Web Developer.Designer.Programmer.President
Volume4.Business.Solution.Developers
emotionalize.conceptualize.visualize.realize
Landlines
Tel: +27125468436
Fax: +27125468436
Web
email:[hidden email]
Global: www.volume4.com
Messenger
Yahoo!: v_olume4
AOL: v0lume4
MSN: [hidden email]

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: [hidden email]
For additional commands, e-mail: [hidden email]