• 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

Struts 2 FileUpload working locally but not on server

 
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello, I am using the file upload in struts 2 and it works perfectly on my local machine but when I deploy to the server it is not working. I have tried adding: struts.multipart.saveDir="/usr/local/jboss/server/default/work/jboss.web/localhost/easements" to the struts.properties but the path does not seem to make a difference.

The first time I go into the application and try to attach the document I can see the file being written and the log also shows this. I think it is the actual upload that is faling but there are no errors in the log.

Does anyone have any ideas?
 
Katie Doody
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nevermind, it was my code and a stupid mistake. At first I was checking to make sure that the file had a value when I should have been checking to see if the upload had a value since I was creating a new file and copying the upload to this new file. Here is the corrected code:

 
Katie Doody
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ironically, if you check theFile.length() > 0 (wrong) rather than getUpload().length() > 0 it will work on occasion but not consistently.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
katie I am sergio, please email me
 
There is no greater crime than stealing somebody's best friend. I miss you tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic