[opencms-dev] Bug on Alkacon Formgenerator 2.0 - File attachments
Yves Glodt
yg at mind.lu
Wed Nov 23 15:50:44 CET 2011
In case Alkacon is using apache commons fileupload, here is a fix for this
issue:
http://commons.apache.org/fileupload/faq.html#whole-path-from-IE
On 23 November 2011 11:11, Sandrine Prousteau <s.prousteau at eurelis.com>wrote:
> Hi
>
> 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);
>
> Please resolve this issue in the next version of FormGenerator! :)
>
> S.
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20111123/88633445/attachment.htm>
More information about the opencms-dev
mailing list