Guys - Thanks for your help. You both rock.
I passed the URI name as http://10.53.14.148:7002/myName/ and filename as "c:\\crazyname.txt" and get a response code of statusLine>>>HTTP/1.1 200 OK
BUT - cannot find the file on my Application Server. No Exception is being reported too.
Wondering what is happening.
Not sure I understand. This is what I am doing -
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());
> You have to pull the FileItem out of the request. I'm
> not entirely sure when the file is materialized, but
> it may well be at this point. Depending on how you
> have things set up you may be materializing it in
> memory and not on disk. As always, check the docs.
It looks like you're using an old or deprecated API. Check out the API docs. There's sample code near the top, but it's not formatted well, so you'll have to copy/paste and format it to see what it's doing.
http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/httpclient/methods/multipart/MultipartRequestEntity.html
We are talking about the client side of the upload, aren't we? Not the server side? If so then HttpClient (and not File Uploader) is the right tool to use. The code I have for sending a file via a POST request looks like this:method.setRequestEntity(new InputStreamRequestEntity(new FileInputStream(filePath), "text/plain"))
We are indeed discussing about client side of the transfer. I implemented a new client using
post.setRequestEntity(new InputStreamRequestEntity(new FileInputStream(input), input.length()));
I can see the file contents in the Eclipse console display but file does not get created on WebLogic server and I get the following message on the server side.
<Feb 9, 2007 10:56:23 AM EST> <Warning> <netuix> <BEA-423420> <Redirect is executed in begin or refresh action. Redirect url is /console/console.portal?_nfpb=tr
ue&_pageLabel=WebAppApplicationOverviewPage&WebAppApplicationOverviewPortlethandle=com.bea.console.handles.AppDeploymentHandle%28%22com.bea%3AName%3Dvishal%2CTy
pe%3DAppDeployment%22%29.> File not found exception
How can I find out what URI that does not redirect and will work (If this is indeed the issue). Thanks much.