• 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

Cannot see uploaded file for Status Code 200

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Guys - I am trying to upload a file using apache commons http package using the code below. I get a response code of statusLine>>>HTTP/1.1 200 OK BUT I cannot find the file on my Application Server. No Exception is being reported too. Any thoughts are much appreciated.

mPost = new MultipartPostMethod("http://10.53.14.148:7002/"); File f1 = new File(c:\\crazyname.txt);
mPost.addParameter(f1.getName(), f1);
int statusCode1 = client.executeMethod(mPost);
System.out.println("statusLine>>>" + mPost.getStatusLine());
 
drifter
Posts: 1364
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not familiar with this package, but looking at this HttpClient File Upload Article, it looks like you are showing the code that sends the file and not the code that saves the file to your server. In the article the file upload code is shown in ProcessFileUpload.jsp. You seem to be sending the file to http://10.53.14.148:7002/ ... so what is that pointing to?
reply
    Bookmark Topic Watch Topic
  • New Topic