Send file from portlet to webscript
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2009 10:51 AM
hello,
i'm trying to send a file from a portlet to a webscript made for save files in alfresco…
i've a problem with the webscript…the formdata is undefined…i'm thinking that the problem is in the method that send the file at the webscript
can somebody help me??
i'm trying to send a file from a portlet to a webscript made for save files in alfresco…
i've a problem with the webscript…the formdata is undefined…i'm thinking that the problem is in the method that send the file at the webscript
HttpClient client = new HttpClient(); PostMethod filePost = new PostMethod(uri); filePost.setRequestHeader("Content-Type", "multipart/form-data"); Part[] parts = new Part[]{ new FilePart(file.getName(), file) }; filePost.setRequestEntity(new MultipartRequestEntity(parts, filePost.getParams())); filePost.addParameters(params); client.executeMethod(filePost); byte[] responseBody = filePost.getResponseBody();
can somebody help me??
Labels:
- Labels:
-
Archive
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2009 01:52 PM
Hi there,
I have the same issue as well,
http://forums.alfresco.com/en/viewtopic.php?f=36&t=18499
Not sure how to get resolve yet.
Cheers.
I have the same issue as well,
http://forums.alfresco.com/en/viewtopic.php?f=36&t=18499
Not sure how to get resolve yet.
Cheers.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2009 03:34 AM
Hey,
I got it working using Mutlipart request from apache httpclient.
http://hc.apache.org/httpclient-3.x/apidocs/org/apache/commons/httpclient/methods/multipart/Multipar...
Hope this helps.
Cheers!
I got it working using Mutlipart request from apache httpclient.
http://hc.apache.org/httpclient-3.x/apidocs/org/apache/commons/httpclient/methods/multipart/Multipar...
Hope this helps.
Cheers!

