save/open file from other drive

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

edwinayin@qq.com
Ebase User
Posts: 24
Joined: Fri Nov 04, 2016 7:41 pm

save/open file from other drive

#1

Postby edwinayin@qq.com » Mon Apr 24, 2017 7:29 pm

Hello everyone,

All of my generated PDF files and user's attachments (doc, png etc.) are currently saved under the server folder. I am trying to move everything to another drive (etc..d drive) and my website should be able to read files from the new location.

Is there a way to do this?

Please advise.

Thank you so much.

regards,
Edwina
0 x

Segi
Ebase User
Posts: 649
Joined: Mon Dec 09, 2013 6:37 pm

#2

Postby Segi » Mon Apr 24, 2017 11:17 pm

You can always copy or move the files to a different location using

Code: Select all

FileServices.copyFile(fromPath, toPath)
to copy or

Code: Select all

FileServices.moveFile(fromPath, toPath)
to move the file(s).

When you say you that your site should read the files, do you mean that you want to create a hyperlink to the files or do you want to open the files and read the contents ? I don't think you can hyperlink to a location outside of your web server if that's what you're trying to do but you should be able to read the files using the Java File I/O libraries.
0 x

edwinayin@qq.com
Ebase User
Posts: 24
Joined: Fri Nov 04, 2016 7:41 pm

#3

Postby edwinayin@qq.com » Tue Apr 25, 2017 1:28 pm

Hello Segi,

Currently, I am using

Code: Select all

form.displayUrl();
to display my file content, so after the user clicks the hyperlink, the content (picture, text, pdf) will get displayed.

After moving the files outside the web server folder, I realized I can't do this anymore...

regards,
Edwina
0 x

Steve James
Ebase User
Posts: 331
Joined: Mon Mar 10, 2014 8:34 am

#4

Postby Steve James » Tue Apr 25, 2017 1:45 pm

Hi, we created a files / document repository under Tomcat.

Code: Select all

<Context path="/documentrepository" docBase="D&#58;/EbaseDocRepository/DEV/" /&gt;
That way you can save the files outside of Ebase but still be able to refer to them within Tomcat eg http://server.domain.com/documentrepository/thefile.pdf

See https://tomcat.apache.org/tomcat-8.0-do ... ntext.html and search for docBase.
0 x

edwinayin@qq.com
Ebase User
Posts: 24
Joined: Fri Nov 04, 2016 7:41 pm

#5

Postby edwinayin@qq.com » Wed Apr 26, 2017 7:52 pm

Thanks, Steve,

I got this worked by using servlet.

http://forum.ebasetech.com/forum/viewto ... ingcontent

I will try your suggestion next.

regards,
Edwina
0 x

edwinayin@qq.com
Ebase User
Posts: 24
Joined: Fri Nov 04, 2016 7:41 pm

#6

Postby edwinayin@qq.com » Thu Apr 27, 2017 1:40 pm

Hello Steve,

We added the code as you suggested under tomcat\conf\Server.xml on our training server, and it worked perfectly, but is there a way to add it to our integration server?

I think the Server.xml is missing in the local integration server folder, where should we add the context code?

thanks,
Edwina
0 x

Steve James
Ebase User
Posts: 331
Joined: Mon Mar 10, 2014 8:34 am

#7

Postby Steve James » Thu Apr 27, 2017 1:44 pm

Hi Edwina, I do not use the integrated server as it is not full blown Tomcat. I've no idea I'm afraid.

I develop forms in the Designer that points to a server installation of Tomcat.

Ugly but you could have a configuration file that points to the appropriate server based on environment.

Thanks
Steve
0 x

Steve
Moderator
Moderator
Posts: 414
Joined: Fri Sep 07, 2007 3:44 pm
Location: Sandy, UK
Contact:

#8

Postby Steve » Fri Apr 28, 2017 4:41 pm

Hi Edwina,

Have you tried adding this to the ebasetest.xml inside:

<ebase-install-dir>/UfsClient/IntegratedServer

And then restart the UfsClient or Integrated Server

Steve
0 x


Who is online

Users browsing this forum: No registered users and 113 guests