1

I was trying to upload and download files at application level using jelastic server in cloud and I have some issues during downloading the uploaded files

to upload the files I use:

File folder = new File(".." + File.separator + "customFolder");

and the files are uploaded correctly inside of:

/opt/GlassFish/glassfish/domains/customDomain/customFolder/ 

and I can see the files using jelastic dashboard and ssh

but, if I try to download them through application I have a 404 error using this kind of approach

<a href="/../customFolder/file.pdf">Link</a>

I try to use the instructions posted here

Cann't get file from classpath (using NIO2)

but this doesn't work for me. Also I try to use some paths also posted in jelastic documentation (https://jelastic.zendesk.com/hc/en-us/community/posts/206122066-Uploading-Files-to-a-Specific-Folder) but noticed there is no a clear explanation for Glassfish.

Also I figure out that the files are in different locations inside of jelastic application folders

these are the different locations that I have found and tried to use to downloading the files (I changed the access permissions, also without making a successful download):

/opt/GlassFish/glassfish/domains/customDomain/customFolder/
/opt/repo/versions/4.1.1/glassfish/domains/customDomain/customFolder/
/opt/shared/glassfish/domains/customDomain/customFolder/

so my question is what is the correct path to download the files or should I change the upload path?

an example using java code returning the string with the path for download would be appreciated

I'm using Glassfish 4.1.1 for the application

Kukeltje
  • 12,223
  • 4
  • 24
  • 47
  • Could you please provide us with the name of your environment, so we will be able to look closer? As for the paths, you can find the correct path in Dashboard, but actually, all these paths are the same (it's links) – Virtuozzo Jul 10 '17 at 12:03

0 Answers0