cancel
Showing results for 
Search instead for 
Did you mean: 

Send file from portlet to webscript

rascio
Champ in-the-making
Champ in-the-making
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
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??
2 REPLIES 2

calebmei
Champ in-the-making
Champ in-the-making
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.

calebmei
Champ in-the-making
Champ in-the-making
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!  Smiley Very Happy