Upload file to payara5 docroot - java

I've installed payara5 on ubuntu and going to upload file to docroot.i need to know if there is such a capability in payara

Payara doesn't support uploading individual files. It's an application server and supports only uploading whole application packages.
But you can upload files to the docroot manually, e.g. using FTP or SFTP. If you place your files to glassfish/domains/domain1/docroot, they will be served from the root context. E.g., if you upload a file image.jpg to that directory, it will be accessible at http://host:8080/image.jpg

Related

Download a file via Apache Camel SFTP from a directory on a different drive on Windows Server

I am trying to download a file via Apache Camel sftp route. The file is placed in a directory on a different drive on a Windows Server
The route definition is as follows:
from(sftp://hostname:22/../../../D:/FolderName?username=userABC&readLock=changed&delete=true).to(myCustomDirectory)
The rest of the options are not shown. The issue is that when I set the readLock to changed, I am receiving exception: GenericFileOperationFailedException: Cannot list directory: ../../../D:/FolderName. If I remove that option the deletion process is failing.
If the file is placed in a user's home subdirectory everything is fine. But the file is placed on another drive.

How to upload resources files with app to cloud foundry

My project needs to read several files as resource (krb5.conf, truststore, keytab). they are in project directory. e.g. C:\Users\WorkSpace\MyProject\krb5.conf.
However, when I upload my project to cloud foundry, the app cannot find my resource files when running.
This is my first time deploy app on cloud foundry. Is there anyway to upload resources files like text file, image jpg to cloud foundry with project? so app can read those files when running on cloud foundry
When you cf push an application, the cli will upload all files under the specified path. By default, the path is the current directory. You can set a custom path with --path or -p.
The --path and -p argument may also point to zip files or jar files, for Java apps. In that case, the contents of the archive are uploaded.
The only exceptions:
Files listed here.
.cfignore
_darcs
.DS_Store
.git
.gitignore
.hg
manifest.yml
.svn
If you have a .cfignore file (same syntax as .gitignore), anything matched is not uploaded.
To troubleshoot issues:
Check your path. Make sure it's correct and includes your files.
Make sure the files are not being ignored.
Run cf ssh to your app and check if the files exist.
Ensure you're using the correct path to files in the container, use $HOME or /home/vcap/app which are the root for your application files.

Generate PDF file into a remot JBoss server

My application generate PDF and save it in the WAR file. Everything works fine in the localhost but after deploying the WAR under the remote Wildfly server the app can't access the WAR file.
ut.setDestinationFileName( "../../wildfly-9.0.1.Final/standalone/deployments/MyApp.war/Rapport/SampleResult.pdf");
thank you for answering, i found a solution, i don't know if it's the best one but it work:
MyApp.war is a compressed file and ut.setDestinationFileName() can't access to a compressed file so i create a new folder under "wildfly-9.0.1.Final/standalone/deployments" and i name it MyApp.war and there i decompress the real war file and finally i restart the server.

How to download zip file from tomcat server web app location

I am working on ios project. One of the module in that project download *.zip files and extract them into app memory. on the server side I installed tomcat server, and uploaded all *.zip files and some *.txt files to the context path.
But when I call the *.txt file's it's working fine (I am getting text on app and browser) but when I call *.zip's file I got 404 (the requested resource is not available). the url is correct but it's only working for .txt files and some extension files.
I think it's blocking .zip files for security reasons. But I need zip file need to downloaded.
if the .zip files is outside the server webapps path its need to be added on context path (and dir path), and reload the server solves the problem.

Servlets and downloading files

I want to download an image file using a javascript client. Then I want to call the servlet in apache tomcat from the applet.
How do I host the file on tomcat. i.e. the same as hosting it in the 'docroot' folder on regular webserver?
Just drop the file in a subfolder of the /webapps folder. E.g. Tomcat/webapps/images/foo.png. It'll be available by http://localhost:8080/image/foo.png. Or if you already have a webapp, just drop it in the web folder (there where you also put your JSP files and where the /WEB-INF folder is also present).

Categories

Resources