Fórum

Request Entity Too Large

thumbnail
Jobin Mathew, modificado 9 Anos atrás.

Request Entity Too Large

Junior Member Postagens: 77 Data de Entrada: 04/07/14 Postagens Recentes
Hi,
am getting error in my jsf portlet when am trying to upload documents.
error as follows,

Request Entity Too Large
The requested resource
/MyPortal/group/control_panel/manage
does not allow request data with POST requests, or the amount of data provided in the request exceeds the capacity limit.

am using default jsf form which is POST.
my xhtml form is as follows.

<h:form id="formadd" enctype="multipart/form-data" type="post">
</h:form>


please help
Thanks
Jobin Mathew
thumbnail
Jan Geißler, modificado 9 Anos atrás.

RE: Request Entity Too Large

Liferay Master Postagens: 735 Data de Entrada: 05/07/11 Postagens Recentes
Do you Use Tomcat? Does it exceed 2mb?
reference:
http://tomcat.apache.org/tomcat-7.0-doc/config/ajp.html
and search for:
maxPostSize
on the site.
thumbnail
Jobin Mathew, modificado 9 Anos atrás.

RE: Request Entity Too Large

Junior Member Postagens: 77 Data de Entrada: 04/07/14 Postagens Recentes
Jan Geißler:
Do you Use Tomcat? Does it exceed 2mb?
reference:
http://tomcat.apache.org/tomcat-7.0-doc/config/ajp.html
and search for:
maxPostSize
on the site.


Thanks Jan for the reply.
i use Tomcat and tried uploading with a file of size just 250 kb.

i used the following code to add documents to my Blog entry.

FileEntry Dlfile = DLAppServiceUtil.addFileEntry(
					themeDisplay.getScopeGroupId(), folderId,
					FilenameUtils.getName(uploadedFile.getFileName()), uploadedFile.getContentType(),
					uploadedFile.getFileName(), "", "", uploadedFile.getInputstream(),
					uploadedFile.getSize(), serviceContextFile);



is there any limitation of files in the DLAppServiceUtil?
If so, can we change it?

Thanks in advance
Jobin
thumbnail
Jan Geißler, modificado 9 Anos atrás.

RE: Request Entity Too Large

Liferay Master Postagens: 735 Data de Entrada: 05/07/11 Postagens Recentes
There is and you can Change it.
But it is definitely larger than 250kb.
You'll find the Property in the Control Panel in the Server Admin Section.
thumbnail
Jobin Mathew, modificado 9 Anos atrás.

RE: Request Entity Too Large

Junior Member Postagens: 77 Data de Entrada: 04/07/14 Postagens Recentes
but we have option to change upload size of Documents and Media , and it have effect only for DlFileEntry right?
because i changed the limit and tried, but of no use.
thumbnail
Jan Geißler, modificado 9 Anos atrás.

RE: Request Entity Too Large

Liferay Master Postagens: 735 Data de Entrada: 05/07/11 Postagens Recentes
I do think there is another problem. 250kb of size really really shouldn't be a problem.
thumbnail
Jobin Mathew, modificado 9 Anos atrás.

RE: Request Entity Too Large

Junior Member Postagens: 77 Data de Entrada: 04/07/14 Postagens Recentes
but is it because of the difference in
DLAppServiceUtil.addFileEntry
and
DLFileEntryLocalServiceUtil.addFileEntry ?
thumbnail
Kyle Joseph Stiemann, modificado 9 Anos atrás.

RE: Request Entity Too Large

Liferay Master Postagens: 760 Data de Entrada: 14/01/13 Postagens Recentes
Hi Jobin,
If you are still stuck, you may want to look at the ICEfaces Documents Portlet. It has example code for how to upload files to Liferay Documents and Media.

- Kyle
thumbnail
Jobin Mathew, modificado 9 Anos atrás.

RE: Request Entity Too Large

Junior Member Postagens: 77 Data de Entrada: 04/07/14 Postagens Recentes
Thanks,
but as i said above am using


FileEntry Dlfile = DLAppServiceUtil.addFileEntry(
                    themeDisplay.getScopeGroupId(), folderId,
                    FilenameUtils.getName(uploadedFile.getFileName()), uploadedFile.getContentType(),
                    uploadedFile.getFileName(), "", "", uploadedFile.getInputstream(),
                    uploadedFile.getSize(), serviceContextFile);


as you suggested. if i am using

DLFileEntryServiceUtil.addFileEntry(dlFolder.getGroupId(), dlFolder.getRepositoryId(),
dlFolder.getFolderId(), name, uploadedFile.getContentType(), title, description,
changeLog, fileEntryTypeId, fieldsMap, file, inputStream, file.length(),
serviceContext);


it have some difference ? am confused with DLFileEntryServiceUtil,DLFileEntryLocalServiceUtil.
it have something with the error?
i set dl.file.max.size=307200000.
thumbnail
Kyle Joseph Stiemann, modificado 9 Anos atrás.

RE: Request Entity Too Large

Liferay Master Postagens: 760 Data de Entrada: 14/01/13 Postagens Recentes
Sorry Jobin, our demo is out of date. You should actually use DLAppServiceUtil as DLFileEntryServiceUtil is meant for internal use. That being said, I was able to add Documents and Media integration to our Primefaces5 portlet with the following code and it seemed to work with files much larger than 250kb:

try {
ServiceContext serviceContext = new ServiceContext();
serviceContext.setAddGroupPermissions(true);
DLAppServiceUtil.addFileEntry(
LiferayFacesContext.getInstance().getThemeDisplay().getScopeGroupId(),
0L,
uploadedFileWrapper.getName(),
uploadedFileWrapper.getContentType(),
uploadedFileWrapper.getName(),
"",
"",
uploadedFileWrapper.getInputStream(),
uploadedFileWrapper.getSize(),
serviceContext);
}
catch (Exception e) {
// TODO
}


If you want to you can build the primefaces5-portlet from source with my patch and see if it works and see if you are doing anything differently.

- Kyle
thumbnail
Jobin Mathew, modificado 9 Anos atrás.

RE: Request Entity Too Large

Junior Member Postagens: 77 Data de Entrada: 04/07/14 Postagens Recentes
Thanks Kyle,
Let me try this.
thumbnail
Manish Yadav, modificado 9 Anos atrás.

RE: Request Entity Too Large

Expert Postagens: 493 Data de Entrada: 26/05/12 Postagens Recentes
Try to increase upload limit of file size from control pannel
thumbnail
Kyle Joseph Stiemann, modificado 9 Anos atrás.

Moved.

Liferay Master Postagens: 760 Data de Entrada: 14/01/13 Postagens Recentes
Moved to Home » Liferay Faces » Liferay Faces - English