4 Replies Latest reply on Feb 16, 2010 6:21 AM by Tim L

    How to transfer files via JBOSS

    Tim L Newbie

      Hi all

       

      I have am running an application in JBOSS, however within this app  I neeed to distribute files available for downloading e.g. type *.jpg. However I want to be able to add files to the server and make them available for download rather like an FTP (i.e. without having to republish the EAR every time a new file is added). Is this something that is possible in JBOSS  and if so how would I be able to do this...or should I install a seperate FTP server.

       

      Thanks

       

      Tim

        • 1. Re: How to transfer files via JBOSS
          Robert Freund Newbie

          In short yes its possible with JBoss.

           

          You don't have to republish an ear or war for that matter to add files to it once deployed.  If you want FTP like access it's probably quicker to setup an ftp server. If your just uploading a file and then needing to download that file as well just set attachment in the response header (content-disposition) and force the user to download that image. Jboss really has nothing to do with this in terms of capability. You can write the file anywhere accessible in the system and then based on use case either allow access via web (ie. write to war) or no web acess but a download forced by hitting a page. You could even write outside the war have a page like download?image=imageId and then retrieve image from anywhere on the system. In your response again.. set the content as attachement and force the download. It's really implementation specific, not a jboss deal.

          1 of 1 people found this helpful
          • 2. Re: How to transfer files via JBOSS
            Peter Johnson Master

            If you are wanting to easily add files to your app, then you could do one of the following:

             

            a) Deploy the app as an exploded directory and then add the new files to that directory (or a subdirectory) later:

            http://community.jboss.org/wiki/ExplodedDeployment

             

            b) Set up an external directory and place your files there:

            http://community.jboss.org/wiki/ExternalDirectories

            1 of 1 people found this helpful
            • 3. Re: How to transfer files via JBOSS
              Tim L Newbie

              Hi ...

               

              Thanks for responding, i've been having a look at the and the options you have advised. For my use I am basically returning an URL  of a downloadable file in an XML response message sent from JBOSS to a device.  <URL>Download_me.xml</URL> This file is then to be downloaded by the device on receipt of the URL.  Additionally I thefore need to have the capability to upload these files to JBOSS.

               

              I will see if this is possible with the options suggested... any further advice would be appreciated. I will close this question in due course over the following week

               

              Regards

               

              Tim

              • 4. Re: How to transfer files via JBOSS
                Tim L Newbie

                OK ...thanks for your posts, i have managed to find the solution that I was looking for.

                 

                it seems like the feature for Static external files in JBOSS 5.x has been taken out... the link below is the solution I used

                 

                http://www.coderanch.com/t/436452/JBoss/JBoss-virtual-directory-jboss

                 

                regards

                 

                Tim