File upload in Hippo

106 views
Skip to first unread message

SumitP

unread,
Jun 19, 2017, 7:36:37 AM6/19/17
to Hippo Community
Hi,

For File upload is it mandatory to use Enterprise forms? or else we can do this through RESTful POST multipart/form-data.

please suggest!!!


Thanks & Regards,
Sumit Pallakhe.

Marijan Milicevic

unread,
Jun 19, 2017, 10:30:12 AM6/19/17
to hippo-c...@googlegroups.com
On Mon, Jun 19, 2017 at 1:36 PM, SumitP <sumit.p...@gmail.com> wrote:
Hi,

For File upload is it mandatory to use Enterprise forms? or else we can do this through RESTful POST multipart/form-data.


you can use upload just like with any other (servlet/REST) application. 
For REST part there is nothing Hippo related or Hippo specific, so, just follow tutorials at:

cheers
marijan 
please suggest!!!


Thanks & Regards,
Sumit Pallakhe.

--
Hippo Community Group: The place for all discussions and announcements about Hippo CMS (and HST, repository etc. etc.)
 
To post to this group, send email to hippo-community@googlegroups.com
RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
---
You received this message because you are subscribed to the Google Groups "Hippo Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hippo-community+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/hippo-community.
For more options, visit https://groups.google.com/d/optout.

Message has been deleted

SumitP

unread,
Jun 20, 2017, 3:23:17 AM6/20/17
to Hippo Community
Hi marijan,

Thanks for your response.

I am trying to upload Excel file.
for that i have taken simple html form and set method:POST and encrypt:multipart/form-data
also configured controller and added actionlink to the form.

Now when I am submitting the form I getting null value in FormMap.

please suggest what extra configurations required for Fileupload.


regards,
Sumit.



On Monday, June 19, 2017 at 8:00:12 PM UTC+5:30, marijan milicevic wrote:
On Mon, Jun 19, 2017 at 1:36 PM, SumitP <sumit.p...@gmail.com> wrote:
Hi,

For File upload is it mandatory to use Enterprise forms? or else we can do this through RESTful POST multipart/form-data.


you can use upload just like with any other (servlet/REST) application. 
For REST part there is nothing Hippo related or Hippo specific, so, just follow tutorials at:

cheers
marijan 
please suggest!!!


Thanks & Regards,
Sumit Pallakhe.

--
Hippo Community Group: The place for all discussions and announcements about Hippo CMS (and HST, repository etc. etc.)
 
To post to this group, send email to hippo-c...@googlegroups.com

RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
---
You received this message because you are subscribed to the Google Groups "Hippo Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hippo-communi...@googlegroups.com.

SumitP

unread,
Jun 22, 2017, 10:55:17 AM6/22/17
to Hippo Community
Hello,
can anyone suggest how to upload file in HIPPO..
I tried to upload file with RESTFul but its not working.(I am able to inject row data like json/xml through RESTful)

please suggest is there any other configurations required for file upload in hippo.


regards,
Sumit.

Marijan Milicevic

unread,
Jun 22, 2017, 11:10:26 AM6/22/17
to hippo-c...@googlegroups.com
On Thu, Jun 22, 2017 at 4:55 PM, SumitP <sumit.p...@gmail.com> wrote:
Hello,
can anyone suggest how to upload file in HIPPO..
I tried to upload file with RESTFul but its not working.(I am able to inject row data like json/xml through RESTful)

 
what have you tried, what doesn't work and what errors (if any) do you get?
Could you attach your code in here, that might help. 
Did you follow CXF documentation as suggested?
cheers
/m
To post to this group, send email to hippo-community@googlegroups.com

RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
---
You received this message because you are subscribed to the Google Groups "Hippo Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hippo-community+unsubscribe@googlegroups.com.
Message has been deleted

SumitP

unread,
Jun 28, 2017, 3:45:38 AM6/28/17
to Hippo Community
Hi, 

I tried following things,

1.Installed HIPPO's Rest plugin 
2.creted Rest Resource class

@Path("/storelocatorservice/")
public class StoreLocatorServices extends BaseRestResource {
@POST
@Path("/upload")
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces(MediaType.APPLICATION_JSON)
public void uploadFile(@FormDataParam("file") InputStream uploadedInputStream) {
HippoRepository repository;
Session session = null;

try {
repository = HippoRepositoryFactory.getHippoRepository(Constants.HIPPO_REPOSITORY);
session = repository.login(Constants.USERNAME, Constants.PASSWORD.toCharArray());
StoreLocatorService service = new StoreLocatorService();
service.createDeales(session);
} catch (RepositoryException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}

3.configured resource mapping in spring-plain-rest-api.xml

<bean class="org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider">
<constructor-arg>
<bean class="com.test.rest.StoreLocatorServices" />
</constructor-arg>
</bean>


4.now I tried to inject file using POSTMAN Rest Client.
header : content-type : multipart/form-data

Getting 415 :: Unsupported media type


regards,
Sumit Pallakhe.

SumitP

unread,
Jul 11, 2017, 3:04:12 AM7/11/17
to Hippo Community
Hi,

anyone want to comment on this???

regards,
sumit.
Reply all
Reply to author
Forward
0 new messages