cancel
Showing results for 
Search instead for 
Did you mean: 

Backoffice Upload Error

Former Member
0 Kudos
901

I have created a editor for file upload and used OOB ImpExExportResultDownload for file download.I have called both of these in backoffice editor area,but whenever I download file and then try to upload file,on selecting the file for upload error popup is shown saying "The server is temporarily out of service". Its giving 410 zk error in response header.I am using ZK File Upload component in my renderer. It works fine after refreshing,but issue comes if I click download and then try to upload.

Former Member
0 Kudos

Hi,

I have a requirement to upload a file in backoffice. Can you please explain how did you implement file upload in backoffice?

Thank you!

Karthik

View Entire Topic
0 Kudos

Hi was this issue resolved? We're on Hybris 6.4, and it seems not changed:

 private void handleUploadEvent(final EditorContext<ImpExFileUploadResult> context, final UploadEvent event) {
     this.uploadedMedia = event.getMedia();
     final String name = this.uploadedMedia.getName();
     final String size = FileUtils.byteCountToDisplaySize(this.getUploadedMediaByteSize());
     this.showUploadedFileDetails((Component)this.uploadedFileDetails, context, name, size);
     this.buttonsUploadedState();
 }    

I'm actually receiving error uploading impex from "system->tools->impex import" just after choosing the file. It seems getUploadedMediaByteSize method cannot retrieve the media file to calculate the size, it just happens sometimes with every file size (tried from 1K to 1M)

 ERROR [UiEngineImpl] (UiEngineImpl.java:1481) java.lang.IllegalStateException: Use getReaderData() instead
     at org.zkoss.util.media.AMedia.newIllegalStateException(AMedia.java:358)
     at org.zkoss.util.media.AMedia.getStreamData(AMedia.java:342)
     at de.hybris.platform.platformbackoffice.widgets.impex.ImpExFileUploadEditor.getUploadedMediaByteSize(ImpExFileUploadEditor.java:242)
     at de.hybris.platform.platformbackoffice.widgets.impex.ImpExFileUploadEditor.handleUploadEvent(ImpExFileUploadEditor.java:265)
     at de.hybris.platform.platformbackoffice.widgets.impex.ImpExFileUploadEditor.lambda$0(ImpExFileUploadEditor.java:105)
     at org.zkoss.zk.ui.AbstractComponent.onEvent(AbstractComponent.java:3163)
     at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:3133)
     at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:3075)
     at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:138)