FAQ
Hi

I'm trying to use the UploadedFile class to upload files. It works great
until I try to upload a file with a name containing non-ascii chars
(Spanish chars for example).

I can have 2 copies of the same file - one with only ascii chars in the
filename, and one with non-ascii chars, but only the ascii named file
succeeds the upload.

Is there a way to solve this?

Thanks,

Eitan

Search Discussions

  • Bruno Aranda at Jun 22, 2005 at 6:43 am
    Eitan, I've tried to reproduce this using the fileUpload example of
    the myfaces examples. I've created two image files: testimage.png and
    tèstímägê.png, and both files have been uploaded without problems. You
    could check what is the difference between your application code and
    the examples. To do so, you should download the examples source from
    the web site,

    Regards,

    Bruno


    2005/6/21, Gur Eitan <gur@axismobile.com>:


    Hi

    I'm trying to use the UploadedFile class to upload files. It works great
    until I try to upload a file with a name containing non-ascii chars (Spanish
    chars for example).

    I can have 2 copies of the same file – one with only ascii chars in the
    filename, and one with non-ascii chars, but only the ascii named file
    succeeds the upload.

    Is there a way to solve this?

    Thanks,

    Eitan
  • Gur Eitan at Jun 22, 2005 at 6:52 am
    Hi Bruno,
    Thanks a lot for your reply. The thing is I tried it with the example...
    I even tried it now again with the name you gave it, and it doesn't succeed.
    I also tried it with images other than png, and it fails as well.

    Thanks,

    Eitan

    -----Original Message-----
    From: Bruno Aranda
    Sent: Wednesday, June 22, 2005 8:41 AM
    To: MyFaces Discussion
    Subject: Re: Uploading file with a name containing non-ascii chars

    Eitan, I've tried to reproduce this using the fileUpload example of
    the myfaces examples. I've created two image files: testimage.png and
    tèstímägê.png, and both files have been uploaded without problems. You
    could check what is the difference between your application code and
    the examples. To do so, you should download the examples source from
    the web site,

    Regards,

    Bruno


    2005/6/21, Gur Eitan <gur@axismobile.com>:


    Hi

    I'm trying to use the UploadedFile class to upload files. It works great
    until I try to upload a file with a name containing non-ascii chars (Spanish
    chars for example).

    I can have 2 copies of the same file - one with only ascii chars in the
    filename, and one with non-ascii chars, but only the ascii named file
    succeeds the upload.

    Is there a way to solve this?

    Thanks,

    Eitan
  • Bruno Aranda at Jun 22, 2005 at 7:07 am
    Even stranger. I've done the test with a jpg filename with stresses
    and no problem. Which version are you using? Have you tried with a
    niglthly?

    Regards,

    Bruno

    2005/6/22, Gur Eitan <gur@axismobile.com>:
    Hi Bruno,
    Thanks a lot for your reply. The thing is I tried it with the example...
    I even tried it now again with the name you gave it, and it doesn't succeed.
    I also tried it with images other than png, and it fails as well.

    Thanks,

    Eitan

    -----Original Message-----
    From: Bruno Aranda
    Sent: Wednesday, June 22, 2005 8:41 AM
    To: MyFaces Discussion
    Subject: Re: Uploading file with a name containing non-ascii chars

    Eitan, I've tried to reproduce this using the fileUpload example of
    the myfaces examples. I've created two image files: testimage.png and
    tèstímägê.png, and both files have been uploaded without problems. You
    could check what is the difference between your application code and
    the examples. To do so, you should download the examples source from
    the web site,

    Regards,

    Bruno

    2005/6/21, Gur Eitan <gur@axismobile.com>:


    Hi

    I'm trying to use the UploadedFile class to upload files. It works great
    until I try to upload a file with a name containing non-ascii chars (Spanish
    chars for example).

    I can have 2 copies of the same file - one with only ascii chars in the
    filename, and one with non-ascii chars, but only the ascii named file
    succeeds the upload.

    Is there a way to solve this?

    Thanks,

    Eitan
  • Jan Behrens at Jun 22, 2005 at 7:16 am
    hi,

    just taking a wild guess - but have you checked whether this behaviour
    might be browser related? i remember that some had issues regarding the
    handling of uploads, so maybe the request part is messed up by the client
    and you therefore see errors on the server (e.g. myfaces)...

    cheers, jan



    Bruno Aranda <brunoaranda@gmail.com>
    22.06.2005 09:06
    Bitte antworten an
    "MyFaces Discussion" <users@myfaces.apache.org>


    An
    Gur Eitan <gur@axismobile.com>
    Kopie
    MyFaces Discussion <users@myfaces.apache.org>
    Thema
    Re: Uploading file with a name containing non-ascii chars






    Even stranger. I've done the test with a jpg filename with stresses
    and no problem. Which version are you using? Have you tried with a
    niglthly?

    Regards,

    Bruno

    2005/6/22, Gur Eitan <gur@axismobile.com>:
    Hi Bruno,
    Thanks a lot for your reply. The thing is I tried it with the example...
    I even tried it now again with the name you gave it, and it doesn't succeed.
    I also tried it with images other than png, and it fails as well.

    Thanks,

    Eitan

    -----Original Message-----
    From: Bruno Aranda
    Sent: Wednesday, June 22, 2005 8:41 AM
    To: MyFaces Discussion
    Subject: Re: Uploading file with a name containing non-ascii chars

    Eitan, I've tried to reproduce this using the fileUpload example of
    the myfaces examples. I've created two image files: testimage.png and
    tèstímägê.png, and both files have been uploaded without problems. You
    could check what is the difference between your application code and
    the examples. To do so, you should download the examples source from
    the web site,

    Regards,

    Bruno

    2005/6/21, Gur Eitan <gur@axismobile.com>:


    Hi

    I'm trying to use the UploadedFile class to upload files. It works
    great
    until I try to upload a file with a name containing non-ascii chars
    (Spanish
    chars for example).

    I can have 2 copies of the same file - one with only ascii chars in
    the
    filename, and one with non-ascii chars, but only the ascii named file
    succeeds the upload.

    Is there a way to solve this?

    Thanks,

    Eitan
  • Guy Katz at Jun 22, 2005 at 7:08 am
    i remember having this problem a while ago.
    you can try and play with the form html attributes such as 'charset' to see if you get the behavior you want.

    what i eventually did(and i dont recommend this - it takes time) is hooked cos.jar (file upload library from servlets.com) to the faces file upload component instead of commons-upload. the API of cos.jar classes allow to pass a character encoding to the constructor on the root objects before the actual stream parsing begins (commons-upload did not allow that). so i explicitly set it to utf-8 and i worked great.
    you can maybe go into the commons-upload and see how the algorithms that determines the encoding for the multipart/form-data stream works and than you can fegure out what to do.


    -----Original Message-----
    From: Gur Eitan
    Sent: Wednesday, June 22, 2005 10:51 AM
    To: MyFaces Discussion; Bruno Aranda
    Subject: RE: Uploading file with a name containing non-ascii chars


    Hi Bruno,
    Thanks a lot for your reply. The thing is I tried it with the example...
    I even tried it now again with the name you gave it, and it doesn't succeed.
    I also tried it with images other than png, and it fails as well.

    Thanks,

    Eitan

    -----Original Message-----
    From: Bruno Aranda
    Sent: Wednesday, June 22, 2005 8:41 AM
    To: MyFaces Discussion
    Subject: Re: Uploading file with a name containing non-ascii chars

    Eitan, I've tried to reproduce this using the fileUpload example of
    the myfaces examples. I've created two image files: testimage.png and
    tèstímägê.png, and both files have been uploaded without problems. You
    could check what is the difference between your application code and
    the examples. To do so, you should download the examples source from
    the web site,

    Regards,

    Bruno


    2005/6/21, Gur Eitan <gur@axismobile.com>:


    Hi

    I'm trying to use the UploadedFile class to upload files. It works great
    until I try to upload a file with a name containing non-ascii chars (Spanish
    chars for example).

    I can have 2 copies of the same file - one with only ascii chars in the
    filename, and one with non-ascii chars, but only the ascii named file
    succeeds the upload.

    Is there a way to solve this?

    Thanks,

    Eitan
  • Gur Eitan at Jun 22, 2005 at 7:34 am
    Jan you're the greatest!!!
    It appears as if the problem occurred to me only with Firefox, but in IE it's ok. I checked the encoding of both browsers, and they are both Unicode (UTF-8).
    I'll try to ask with the Firefox community, if they know something.

    Thank you all for your help,

    Eitan

    -----Original Message-----
    From: Jan Behrens
    Sent: Wednesday, June 22, 2005 9:16 AM
    To: MyFaces Discussion
    Subject: Antwort: Re: Uploading file with a name containing non-ascii chars

    hi,

    just taking a wild guess - but have you checked whether this behaviour
    might be browser related? i remember that some had issues regarding the
    handling of uploads, so maybe the request part is messed up by the client
    and you therefore see errors on the server (e.g. myfaces)...

    cheers, jan



    Bruno Aranda <brunoaranda@gmail.com>
    22.06.2005 09:06
    Bitte antworten an
    "MyFaces Discussion" <users@myfaces.apache.org>


    An
    Gur Eitan <gur@axismobile.com>
    Kopie
    MyFaces Discussion <users@myfaces.apache.org>
    Thema
    Re: Uploading file with a name containing non-ascii chars






    Even stranger. I've done the test with a jpg filename with stresses
    and no problem. Which version are you using? Have you tried with a
    niglthly?

    Regards,

    Bruno

    2005/6/22, Gur Eitan <gur@axismobile.com>:
    Hi Bruno,
    Thanks a lot for your reply. The thing is I tried it with the example...
    I even tried it now again with the name you gave it, and it doesn't succeed.
    I also tried it with images other than png, and it fails as well.

    Thanks,

    Eitan

    -----Original Message-----
    From: Bruno Aranda
    Sent: Wednesday, June 22, 2005 8:41 AM
    To: MyFaces Discussion
    Subject: Re: Uploading file with a name containing non-ascii chars

    Eitan, I've tried to reproduce this using the fileUpload example of
    the myfaces examples. I've created two image files: testimage.png and
    tèstímägê.png, and both files have been uploaded without problems. You
    could check what is the difference between your application code and
    the examples. To do so, you should download the examples source from
    the web site,

    Regards,

    Bruno

    2005/6/21, Gur Eitan <gur@axismobile.com>:


    Hi

    I'm trying to use the UploadedFile class to upload files. It works
    great
    until I try to upload a file with a name containing non-ascii chars
    (Spanish
    chars for example).

    I can have 2 copies of the same file - one with only ascii chars in
    the
    filename, and one with non-ascii chars, but only the ascii named file
    succeeds the upload.

    Is there a way to solve this?

    Thanks,

    Eitan
  • Bruno Aranda at Jun 22, 2005 at 7:48 am
    Well, actually I am using firefox, although it is the Firefox Deer
    Park Alpha 1 (an alpha version for firefox 1.1). I cannot try now with
    earlier versions (eg. 1.0.4), so if someone could test that...

    Regards,

    Bruno

    2005/6/22, Gur Eitan <gur@axismobile.com>:
    Jan you're the greatest!!!
    It appears as if the problem occurred to me only with Firefox, but in IE it's ok. I checked the encoding of both browsers, and they are both Unicode (UTF-8).
    I'll try to ask with the Firefox community, if they know something.

    Thank you all for your help,

    Eitan

    -----Original Message-----
    From: Jan Behrens
    Sent: Wednesday, June 22, 2005 9:16 AM
    To: MyFaces Discussion
    Subject: Antwort: Re: Uploading file with a name containing non-ascii chars

    hi,

    just taking a wild guess - but have you checked whether this behaviour
    might be browser related? i remember that some had issues regarding the
    handling of uploads, so maybe the request part is messed up by the client
    and you therefore see errors on the server (e.g. myfaces)...

    cheers, jan

    Bruno Aranda <brunoaranda@gmail.com>
    22.06.2005 09:06
    Bitte antworten an
    "MyFaces Discussion" <users@myfaces.apache.org>

    An
    Gur Eitan <gur@axismobile.com>
    Kopie
    MyFaces Discussion <users@myfaces.apache.org>
    Thema
    Re: Uploading file with a name containing non-ascii chars

    Even stranger. I've done the test with a jpg filename with stresses
    and no problem. Which version are you using? Have you tried with a
    niglthly?

    Regards,

    Bruno

    2005/6/22, Gur Eitan <gur@axismobile.com>:
    Hi Bruno,
    Thanks a lot for your reply. The thing is I tried it with the example...
    I even tried it now again with the name you gave it, and it doesn't succeed.
    I also tried it with images other than png, and it fails as well.

    Thanks,

    Eitan

    -----Original Message-----
    From: Bruno Aranda
    Sent: Wednesday, June 22, 2005 8:41 AM
    To: MyFaces Discussion
    Subject: Re: Uploading file with a name containing non-ascii chars

    Eitan, I've tried to reproduce this using the fileUpload example of
    the myfaces examples. I've created two image files: testimage.png and
    tèstímägê.png, and both files have been uploaded without problems. You
    could check what is the difference between your application code and
    the examples. To do so, you should download the examples source from
    the web site,

    Regards,

    Bruno

    2005/6/21, Gur Eitan <gur@axismobile.com>:


    Hi

    I'm trying to use the UploadedFile class to upload files. It works
    great
    until I try to upload a file with a name containing non-ascii chars
    (Spanish
    chars for example).

    I can have 2 copies of the same file - one with only ascii chars in
    the
    filename, and one with non-ascii chars, but only the ascii named file
    succeeds the upload.

    Is there a way to solve this?

    Thanks,

    Eitan
  • Jan Behrens at Jun 22, 2005 at 10:57 am
    hi,

    glad it helped somewhat. bruno, different behaviour on same type browser
    might be also related to different standard encodings used as browser
    defaults - which in turn might depend on your current locale and other
    settings. eitan, you might want to look into this as well...

    cheers, jan



    Bruno Aranda <brunoaranda@gmail.com>
    22.06.2005 09:48
    Bitte antworten an
    "MyFaces Discussion" <users@myfaces.apache.org>


    An
    MyFaces Discussion <users@myfaces.apache.org>
    Kopie

    Thema
    Re: Antwort: Re: Uploading file with a name containing non-ascii chars






    Well, actually I am using firefox, although it is the Firefox Deer
    Park Alpha 1 (an alpha version for firefox 1.1). I cannot try now with
    earlier versions (eg. 1.0.4), so if someone could test that...

    Regards,

    Bruno

    2005/6/22, Gur Eitan <gur@axismobile.com>:
    Jan you're the greatest!!!
    It appears as if the problem occurred to me only with Firefox, but in IE
    it's ok. I checked the encoding of both browsers, and they are both
    Unicode (UTF-8).
    I'll try to ask with the Firefox community, if they know something.

    Thank you all for your help,

    Eitan

    -----Original Message-----
    From: Jan Behrens
    Sent: Wednesday, June 22, 2005 9:16 AM
    To: MyFaces Discussion
    Subject: Antwort: Re: Uploading file with a name containing non-ascii chars
    hi,

    just taking a wild guess - but have you checked whether this behaviour
    might be browser related? i remember that some had issues regarding the
    handling of uploads, so maybe the request part is messed up by the client
    and you therefore see errors on the server (e.g. myfaces)...

    cheers, jan

    Bruno Aranda <brunoaranda@gmail.com>
    22.06.2005 09:06
    Bitte antworten an
    "MyFaces Discussion" <users@myfaces.apache.org>

    An
    Gur Eitan <gur@axismobile.com>
    Kopie
    MyFaces Discussion <users@myfaces.apache.org>
    Thema
    Re: Uploading file with a name containing non-ascii chars

    Even stranger. I've done the test with a jpg filename with stresses
    and no problem. Which version are you using? Have you tried with a
    niglthly?

    Regards,

    Bruno

    2005/6/22, Gur Eitan <gur@axismobile.com>:
    Hi Bruno,
    Thanks a lot for your reply. The thing is I tried it with the
    example...
    I even tried it now again with the name you gave it, and it doesn't succeed.
    I also tried it with images other than png, and it fails as well.

    Thanks,

    Eitan

    -----Original Message-----
    From: Bruno Aranda
    Sent: Wednesday, June 22, 2005 8:41 AM
    To: MyFaces Discussion
    Subject: Re: Uploading file with a name containing non-ascii chars

    Eitan, I've tried to reproduce this using the fileUpload example of
    the myfaces examples. I've created two image files: testimage.png and
    tèstímägê.png, and both files have been uploaded without problems. You
    could check what is the difference between your application code and
    the examples. To do so, you should download the examples source from
    the web site,

    Regards,

    Bruno

    2005/6/21, Gur Eitan <gur@axismobile.com>:


    Hi

    I'm trying to use the UploadedFile class to upload files. It works
    great
    until I try to upload a file with a name containing non-ascii chars
    (Spanish
    chars for example).

    I can have 2 copies of the same file - one with only ascii chars in
    the
    filename, and one with non-ascii chars, but only the ascii named
    file
    succeeds the upload.

    Is there a way to solve this?

    Thanks,

    Eitan

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupusers @
categoriesmyfaces
postedJun 21, '05 at 11:04a
activeJun 22, '05 at 10:57a
posts9
users4
websitemyfaces.apache.org

People

Translate

site design / logo © 2019 Grokbase