Üdv.
Képeket szeretnék feltölteni és emellett adatokat is adni ehhez a képhez mint pl.: image_gallery kicsit máskép lényeg, hogy valamiért nem megy.
Ha a jsp-ben bele írom, hogy
1<aui:form action="${updateProductURL}" enctype="multipart/form-data" method="post" >
Akkor nem éri el az adatokat, ha nem írom bele az enctype-t akkor természetesen nem kapok uploadrequestet mert azt írja vagy multipart/form-data vagy multipart/mixed kell, ha mixedet írok be ugyan ezt írja ki szóval valószínűleg fel sem ismeri.
1
209:46:43,601 ERROR [UploadServletRequestImpl:101] org.apache.commons.fileupload.FileUploadBase$InvalidContentTypeException: the request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is application/x-www-form-urlencoded
3org.apache.commons.fileupload.FileUploadBase$InvalidContentTypeException: the request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is application/x-www-form-urlencoded
1
2 UploadPortletRequest uploadRequest = PortalUtil.getUploadPortletRequest(actionRequest);
3 File file = uploadRequest.getFile(upload_field);
4 long imageId = CounterLocalServiceUtil.increment();
5 ImageLocalServiceUtil.updateImage(imageId, file);
ha bele nézek a paraméter nevek közé csak 1 vagy kettő alap paraméter van benne a form adatai nem, ha kiveszem az enctype-t akkor minden látszik csak ugye feltölteni nem tudom liferay ver. 6.0.5 MVCPortlet.
Portlet.xml:
1 <portlet>
2 <description>Products</description>
3 <portlet-name>Products</portlet-name>
4 <display-name>Products</display-name>
5 <portlet-class>hu.bms.liferay.webshop.products.ProductsAction</portlet-class>
6 <init-param>
7 <name>view-jsp</name>
8 <value>/jsp/products/Products_view.jsp</value>
9 </init-param>
10 <init-param>
11 <name>edit-jsp</name>
12 <value>/jsp/products/Products_edit.jsp</value>
13 </init-param>
14 <init-param>
15 <name>editproduct-jsp</name>
16 <value>/jsp/products/Products_editproduct.jsp</value>
17 </init-param>
18 <init-param>
19 <name>check-auth-token</name>
20 <value>false</value>
21 </init-param>
22 <expiration-cache>0</expiration-cache>
23 <supports>
24 <mime-type>text/html</mime-type>
25 <portlet-mode>VIEW</portlet-mode>
26 <portlet-mode>EDIT</portlet-mode>
27 </supports>
28 <resource-bundle>hu.bms.liferay.webshop.products.messages</resource-bundle>
29 <portlet-info>
30 <title>Products</title>
31 <short-title>Products</short-title>
32 </portlet-info>
33 <supported-public-render-parameter>ipc_productcategoryid</supported-public-render-parameter>
34 </portlet>
Mészáros László