116
Views
9
Comments
[Web Previewer] Nothing appears when previewing docx file
Question
Forge component by Rui Mendes
20
Published on 19 Nov 2018

I have an Upload widget and I copy the content of that widget to a file variable that is set as the file input parameter of the Web Previewer.  After doing a refresh on the Web Previewer there is nothing displayed, am I doing something wrong maybe?

There maybe something underlying wrong however as only the URL preview works in the sample component, everything else generates an error.  I'm working on Outsystems v10.

Rank: #380

Hi Sienna,

I'm not the developer of Web Previewer, but maybe I can help. A common mistake with file upload is that the upload button's method is set as Ajax Submit instead of a normal Submit. This would result in what you describe; nothing is shown, because the binary isn't uploaded to the server. To get the binary on the server side, you need to set the Upload method to Submit.

Regards,
Lennart

Rank: #419

Thanks for replying Lennart!

My button is already set to Submit unfortunately.  I can see in the debugger that the file passed has binary content.  It has no other parameters set other than the content though, does it require something else do you know?

Sienna

mvp_badge
MVP
Rank: #16

Hi Sienna,

Can you post here a simple example on what you are doing. Btw that happen with all the docx or just with a specific one?

Regards,

Marcelo

Rank: #419

Hi Marcelo,

It happens with any docx.  I'm just doing it in a test module so there's nothing in there except the following...

Many thanks for your assistance!

Rank: #571

Have you tried to set the file.fileType and the file.Filename ? because the component seems to use the file type and filename to know how to show the file

mvp_badge
MVP
Rank: #16

Hi Sienna,

Beside using the FileType and Filename try to use for width and height "200px" and "300px" instead.

Regards,

Marcelo

Rank: #419

So sorry for the very delayed reply but I was working on something else and have only just got back to this, my apologies.  And thank you all for your replies, it's very much appreciated!

The width and height won't take the 'px', it accepts numerical characters only.  And I have no idea what I should be entering as the file type as it is just a text data type and not a static entity.  However I have looked at the oml that Rui very kindly shared and copied the file type from that after opening a Word doc (which is what type of file I'm working with), and the information on the Submit makes sense, but I still cannot get mine to work.

I am also trying it out in another scenario whereby a link opens a new webscreen that should display a Word file on the server.  However this is the result....


This is from the preparation (the Download server action downloads a file from Sharepoint and returns the filepath on the server where the file is downloaded to, along with the file's content in binary form)...

Rank: #419

I got it working in the end.  For anyone else struggling, see:

https://www.outsystems.com/forums/discussion/49440/sample-doesnt-work-for-database-files/