Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formgenerator 2.0 on OpenCms 8.0.2 - filenames #10

Open
pStrudthoff opened this issue Apr 5, 2012 · 0 comments
Open

Formgenerator 2.0 on OpenCms 8.0.2 - filenames #10

pStrudthoff opened this issue Apr 5, 2012 · 0 comments

Comments

@pStrudthoff
Copy link
Contributor

I found an issue in Alkacon Formgenerator 2.0 on OpenCms 8.0.2.
I have a form with file fields, with can be submit from Internet Explorer 6.
IE6 set the value as a full path (C:..) with Windows separator "".
If OpenCms is installed on a server on Linux, le line 1911 in sendMail()
function :
String filename =
attachment.getName().substring(attachment.getName().lastIndexOf(File.sep
arator) + 1);
try to extract the filename with "/"...
So with IE6, the mail received contains attachment with the full path of user's
file!

In my project, I have overload Alkacon classes with a custom jsp, and put this
code:
int index_start_name = 0;
if(attachment.getName().lastIndexOf(File.separator)!=-1){
index_start_name =
attachment.getName().lastIndexOf(File.separator) + 1; }else
if(attachment.getName().lastIndexOf("/")!=-1){
index_start_name =
attachment.getName().lastIndexOf("/") + 1; }else
if(attachment.getName().lastIndexOf("")!=-1){
index_start_name =
attachment.getName().lastIndexOf("") + 1; } String filename =
attachment.getName().substring(index_start_name);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant