You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Amit Badheka <am...@direct2s.com> on 2002/12/23 10:15:39 UTC

Access external file from web application

Hi All,

Is there any way to access a file(image,..etc) from the web application. the path of the image is dynamically generated.

The requirement is that we have to upload a image file and store it to somewhere on server at dynamically generated path. Now, Problem is how I should refer this file from the application, As the application don't know the path at the time of implementation(application).

Please help. 

Re: Access external file from web application

Posted by Eddie Bush <ek...@swbell.net>.
Amit Badheka wrote:

>Hi,
>
>>So, basically what you're looking for is some way to dynamically set the
>>directory that the files are stored in?  You could do that easily with a
>>property file.  Your end user would set the appropriate property in some
>>properties file that is in the classpath of the application server and
>>then ... you just load that up and use that as your "base path".
>>
>Thanks for your reply. Can u tell me how would i map the basepath in my web
>application to a path
>on the file system for accessing such resources?
>
How you would map it?

>I am using weblogic
>applicaton
>server. Are u aware of any such mechanism in weblogic? I am aware that such
>mappings are possible in apache using <Directory> and <Alias> tag. I have
>got stuck
>in regards to weblogic.
>
I don't use web logic.  There are many mechanisms available to you that 
have nothing whatsoever to do with your application server.  The 
properties file I suggested is a "Java thing" and should work in any 
application server.  The init parameters are equally standard.  You just 
need to choose some way to say "This is where my directory is" and then 
use it.

>>You
>>could do the same thing by using init param elements for the action
>>servlet -- or context parameters.  Using the property file approach
>>removes the need for your end user to have the ability to modify the
>>server config file(s).
>>
>Regards,
>Amit Badekha.
>
>>Amit Badheka wrote:
>>
>>>Hi All,
>>>
>>>Is there any way to access a file(image,..etc) from the web application.
>>>      
>>>
>the path of the image is dynamically generated.
>  
>
>>>The requirement is that we have to upload a image file and store it to
>>>      
>>>
>somewhere on server at dynamically generated path. Now, Problem is how I
>should refer this file from the application, As the application don't know
>the path at the time of implementation(application).
>  
>
>>>Please help.
>>>

-- 
Eddie Bush





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Access external file from web application

Posted by Amit Badheka <am...@direct2s.com>.
Hi,


> So, basically what you're looking for is some way to dynamically set the
> directory that the files are stored in?  You could do that easily with a
> property file.  Your end user would set the appropriate property in some
> properties file that is in the classpath of the application server and
> then ... you just load that up and use that as your "base path".

Thanks for your reply. Can u tell me how would i map the basepath in my web
application to a path
on the file system for accessing such resources? I am using weblogic
applicaton
server. Are u aware of any such mechanism in weblogic? I am aware that such
mappings are possible in apache using <Directory> and <Alias> tag. I have
got stuck
in regards to weblogic.

> You
> could do the same thing by using init param elements for the action
> servlet -- or context parameters.  Using the property file approach
> removes the need for your end user to have the ability to modify the
> server config file(s).
>


Regards,
Amit Badekha.


> Amit Badheka wrote:
>
> >Hi All,
> >
> >Is there any way to access a file(image,..etc) from the web application.
the path of the image is dynamically generated.
> >
> >The requirement is that we have to upload a image file and store it to
somewhere on server at dynamically generated path. Now, Problem is how I
should refer this file from the application, As the application don't know
the path at the time of implementation(application).
> >
> >Please help.
> >
> >
> >
>
> --
> Eddie Bush
>
>
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Access external file from web application

Posted by Eddie Bush <ek...@swbell.net>.
So, basically what you're looking for is some way to dynamically set the 
directory that the files are stored in?  You could do that easily with a 
property file.  Your end user would set the appropriate property in some 
properties file that is in the classpath of the application server and 
then ... you just load that up and use that as your "base path".  You 
could do the same thing by using init param elements for the action 
servlet -- or context parameters.  Using the property file approach 
removes the need for your end user to have the ability to modify the 
server config file(s).

Amit Badheka wrote:

>Hi All,
>
>Is there any way to access a file(image,..etc) from the web application. the path of the image is dynamically generated.
>
>The requirement is that we have to upload a image file and store it to somewhere on server at dynamically generated path. Now, Problem is how I should refer this file from the application, As the application don't know the path at the time of implementation(application).
>
>Please help. 
>
>  
>

-- 
Eddie Bush





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>