How to launch the default app for a file from within Ebase

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

neilnewman
Ebase User
Posts: 201
Joined: Fri Dec 20, 2013 1:29 pm
Location: Dartford Borough Council
Contact:

How to launch the default app for a file from within Ebase

#1

Postby neilnewman » Tue May 12, 2015 7:52 am

I have an Ebase application that uploads attachments of various types (.docx,pdf,xls).

I want to be able to open these attachments with the associated Windows application through Ebase.
Does anyone have a piece of code that achieves this please?
0 x

neilnewman
Ebase User
Posts: 201
Joined: Fri Dec 20, 2013 1:29 pm
Location: Dartford Borough Council
Contact:

#2

Postby neilnewman » Tue May 12, 2015 11:39 am

Sorry for the above post, I have since discovered having a URL link to the object allows you to open the file using the PC's own file associations
0 x

User avatar
dvanhussel
Ebase User
Posts: 161
Joined: Fri Oct 19, 2007 12:45 pm
Location: Haarlem, the Netherlands

#3

Postby dvanhussel » Tue May 12, 2015 2:07 pm

Hi Neil,

This is indeed the way to do this. In my experience, some browsers need the correct mime-type set for Office 2007(or higher) files (docx, xlsx). In order to let Tomcat provide the correct mimetypes you need to add them:


1) Go to the install location of Tomcat – <install>\conf and open the web.xml file.
2) Add the following lines in the web.xml:
- For docx files:
<mime>
<extension>docx</extension>
<mime>application/vnd.openxmlformats-officedocument.wordprocessingml.document</mime>
</mime>
- For xlsx files:
<mime>
<extension>xlsx</extension>
<mime>application/vnd.openxmlformats-officedocument.spreadsheetml.sheet</mime>
</mime>
- For pptx files:
<mime>
<extension>pptx</extension>
<mime>application/vnd.openxmlformats-officedocument.presentationml.presentation</mime>
</mime>
3) Restart Tomcat.

Regards,

David
0 x

neilnewman
Ebase User
Posts: 201
Joined: Fri Dec 20, 2013 1:29 pm
Location: Dartford Borough Council
Contact:

#4

Postby neilnewman » Wed May 13, 2015 10:24 am

Many thanks for the info David
0 x


Who is online

Users browsing this forum: No registered users and 15 guests