1

I'm trying to upload a file to the glassfish application server (v4.1) via h:inputfile. xhtml-file and bean are prepared as almost every example in the web shows.

I tried with and without Pretty Filter in web.xml, allowCasualMultipartParsing in context.xml, and a handful of other possible workarounds. None of them seemed to work (i.e. I can't read the file properties inside the bean).

Is there a solution that works 100%?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
dNhax
  • 27
  • 7
  • Are you implying that it works fine when you remove every single bit of PrettyFaces altogether and/or when you run it on a different server than GlassFish? – BalusC Jun 09 '15 at 14:42
  • Unfortunately I have to use these two (for my bachelor thesis). So I don't know exactly if it works otherwise. :-( – dNhax Jun 09 '15 at 15:27
  • 1
    Uh, it's just to test and exclude, so that we know where to focus for the root cause of the problem. – BalusC Jun 09 '15 at 15:27
  • I've the same problem. You can use Prettyface on any other page than the one you upload files from and it's gonna work indeed. – Ced Jun 09 '15 at 16:39
  • Apparently a possible work around is to force primefaces to use common file upload. I'm searching how to do this and will respond if it works when I find how to. – Ced Jun 09 '15 at 17:06
  • I read about putting the actual upload on another page and including it via iFrame on the desired page. How does this work? – dNhax Jun 09 '15 at 17:10
  • So, it's definitely caused by PrettyFaces? Then don't sit back doing nothing with regard to PrettyFaces. Post a bug report at their homepage, so that they can investigate and fix it for the next release. – BalusC Jun 09 '15 at 20:38

1 Answers1

1

Found a sufficient solution, was posted here on stackoverflow.com before: Fileupload and PrettyFaces and JSF 2.2

Not pretty, but it works.

Community
  • 1
  • 1
dNhax
  • 27
  • 7
  • Prettier would be to report it to them so that they are informed about this bug and can fix it accordingly. – BalusC Jun 15 '15 at 09:12