On Tuesday 21 July 2009 03:40:55 am taltun wrote:
> Hi,
>
> When uploading an image using file upload calling this code:
>
> InputStream stream = new BufferedInputStream(new FileInputStream(file));
>
> It seems like the webapplication try to access the filesystem temporary to
> create the file using FileInputStream.
>
> On Windows it works, but it seems like on Unix server it does not have
> permission to access the filesystem using FileInputStream, , am I right ?
>
> - What should I do ?
> - Is there other way to convert a file to inputStream without accessing the
> filesystem ?
>
> -taltun

It is possible that filesystem permissions are a problem. I think your best bet 
is probably to give permissions to a directory where the upload components can 
create a file. The existing components use a constant called 
'struts.multipart.saveDir' to figure out where to put the temp files it creates 
during the upload. Set it to a directory where the user running your app 
server (tomcat) can write (/tmp).

-Wes

-- 
Wes Wannemacher
Author - Struts 2 In Practice 
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

  • Fileupload taltun
    • Re: Fileupload Wes Wannemacher

Reply via email to