Reputation: 343
I'm doing a file upload with Jersey, but I need only the filename. Internet Explorer sends the entire path, and based on what's in FormDataContentDisposition, Jersey parses out the slashes, so I can't even parse that. Thanks.
Upvotes: 7
Views: 2238
Reputation: 11285
I was getting that error when I tried the Eclipse browser. When I tried my code on Chrome, the FormDataContentDisposition.getFileName() was fine.
Upvotes: 0
Reputation: 21598
That hidden input then gets submitted along with the rest of the form.
@kombat has found this solution and posted it as a comment. For better this is now reposted as a community wiki answer.
Upvotes: 3
Reputation: 1123
Sounds like a difficult issue. The ideal case of course is to grab the string containing the slashes and just use string.split!
Failing that, the only strategy i can begin to think of is to try iterating through the string seeing if folders exist for various lengths of the first part of the string etc. This can cause problems too though if you intend to find a folder "MyFolder (2)" and theres also a "MyFolder". I don't know alot about jersey but i would recommend trying to find a different way to grab the string you need.
Upvotes: 2