• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem in uploading file through commons fileupload

 
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I use the commons file upload package to upload files.Problem is that it works fine from some pc and fail when i upload it from another pc.

When i upload it form my pc item.getName() gives me only the name of the file and it successfully uploaded.But when i upload it from my friend pc it item.getName() gives the whole path name of file like D:\\ddd\ddd.xls
and my output file path becomes C:\dhar\D:\\ddd\ddd.xls and then it throws error filenotfoundexception.How to resolve this.
 
amit sharma
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I resolve the issue.It works in my pc because i use firefox and my friend uses IE.IE gives the whole path .To resolve this use following code.


FilenameUtils is in org.apache.commons.io
Hope this helps others
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic