留言板
Implement my own Upload
Hi,
i would like to implement my own upload system.
It would be great if I could use the flash uploader by liferay.
So I do:
<% image = null; %>
<c:if test="<%= image == null %>">
<script type="text/javascript">
jQuery(
function() {
new Liferay.Upload({
allowedFileTypes: '<%= StringUtil.merge(PropsValues.IG_IMAGE_EXTENSIONS) %>',
container: '#<portlet:namespace />fileUpload',
fileDescription: '<%= StringUtil.merge(PropsValues.IG_IMAGE_EXTENSIONS) %>',
fallbackContainer: '#<portlet:namespace />fallback',
maxFileSize: <%= PropsValues.IG_IMAGE_MAX_SIZE %>,
namespace: '<portlet:namespace />',
uploadFile: '<liferay-portlet:actionURL windowState="<%= LiferayWindowState.POP_UP.toString() %>" doAsUserId="<%= user.getUserId() %>"><portlet:param name="struts_action" value="/ext/XXXX/assets/image_management/edit_image" /><portlet:param name="<%= Constants.CMD %>" value="<%= Constants.ADD %>" /><portlet:param name="folderId" value="<%= String.valueOf(folderId) %>" /></liferay-portlet:actionURL><liferay-ui:input-permissions-params modelName="<%= IGImage.class.getName() %>" />'
});
}
);
</script>
<div class="lfr-upload-container" id="<portlet:namespace />fileUpload"></div>
<div class="lfr-fallback" id="<portlet:namespace />fallback">
</c:if>
<liferay-ui:upload-progress
id="<%= uploadProgressId %>"
iframeSrc="<%= uploadProgressURL %>"
redirect="<%= redirect %>"
/>
<c:if test="<%= image == null %>">
</div>
</c:if>
The Problem is that my image is uploaded , I see the progress bar running.
But my action /ext/XXXX/assets/image_management/edit_image is never run.
/ext/XXXX/assets/image_management/edit_image was set up as action like it has to be.
Maybe knows someone what I'm doing wrong.
Please help.
BTW: is it poss. that the user can take only one file to upload ?
i would like to implement my own upload system.
It would be great if I could use the flash uploader by liferay.
So I do:
<% image = null; %>
<c:if test="<%= image == null %>">
<script type="text/javascript">
jQuery(
function() {
new Liferay.Upload({
allowedFileTypes: '<%= StringUtil.merge(PropsValues.IG_IMAGE_EXTENSIONS) %>',
container: '#<portlet:namespace />fileUpload',
fileDescription: '<%= StringUtil.merge(PropsValues.IG_IMAGE_EXTENSIONS) %>',
fallbackContainer: '#<portlet:namespace />fallback',
maxFileSize: <%= PropsValues.IG_IMAGE_MAX_SIZE %>,
namespace: '<portlet:namespace />',
uploadFile: '<liferay-portlet:actionURL windowState="<%= LiferayWindowState.POP_UP.toString() %>" doAsUserId="<%= user.getUserId() %>"><portlet:param name="struts_action" value="/ext/XXXX/assets/image_management/edit_image" /><portlet:param name="<%= Constants.CMD %>" value="<%= Constants.ADD %>" /><portlet:param name="folderId" value="<%= String.valueOf(folderId) %>" /></liferay-portlet:actionURL><liferay-ui:input-permissions-params modelName="<%= IGImage.class.getName() %>" />'
});
}
);
</script>
<div class="lfr-upload-container" id="<portlet:namespace />fileUpload"></div>
<div class="lfr-fallback" id="<portlet:namespace />fallback">
</c:if>
<liferay-ui:upload-progress
id="<%= uploadProgressId %>"
iframeSrc="<%= uploadProgressURL %>"
redirect="<%= redirect %>"
/>
<c:if test="<%= image == null %>">
</div>
</c:if>
The Problem is that my image is uploaded , I see the progress bar running.
But my action /ext/XXXX/assets/image_management/edit_image is never run.
/ext/XXXX/assets/image_management/edit_image was set up as action like it has to be.
Maybe knows someone what I'm doing wrong.
Please help.
BTW: is it poss. that the user can take only one file to upload ?
Still broken in 5.2.2; The Document Library's EditFileAction is never called when using the flash uploader. In IE (6 or 7), the flash control isn't even displayed. Junk.