My webapplication runs in JBoss environment and it uses file upload functionality with out any problem. One thing I am doing differently is writing to a new file after reading it from the uploaded file that way I can control the file name of the file and directory.

Hope that helps,
-M

RFDot <[EMAIL PROTECTED]> wrote:

I am running the example
\src\org\apache\myfaces\examples\misc\FileUploadForm.java
with the following settings on WindowsXP (moving to JBoss Linux) and Java
1.5 and Tomcat-5.5.17
and want to move to JBoss and observed the following when using the Tomahawk
ext to upload files:
Tomahawk seems to have its own ideas about what to name the files when
uploaded.
I need access to the files to manipulate them after upload and need to know
what they are named
and where they are under Tomcat or JBoss Tomcat.

If I upload a file like abc.jpg it reports back fine in the return page as
the correct image and the right name,
but I need to fix two things and I can't seem to trap for them in the
debugger to help figure out where to make
the changes.

1. The file name is always changed to upload_A NUMBER.tmp like this
upload_00000007.tmp rather than the
real name of the file.

2. What ever directory name that I set in the web.xml for
uploadRepositoryPath ends up on the root
of my C drive rather than the root of the application?
I understand from reading that there may be some involvement with the
java.io.tmpdir but I am not sure.

It would be VERY helpful if some one can tell me how to make it write to a
relative directory in the application
context off the application root in JBoss / Tomcat, and how do I best make
it write the file name that I want the first time or at least re-copy it to
the correct directory with the right name.
I have tried to set the debugger to catch when the change is happening but I
have not been successful.



with WebRoot\fileupload.jsp
...




accept="image/*"
value="#{fileUploadForm.upFile}"
storage="file"
styleClass="fileUploadInput"
required="true"
maxlength="200000"/>






action="" />

...


web.xml ...

extensionsFilter
org.apache.myfaces.webapp.filter.ExtensionsFilter

Set the size limit for uploaded files.
Format: 10 - 10 bytes
10k - 10 KB
10m - 10 MB
1g - 1 GB

uploadMaxFileSize
100m


Set the threshold size - files
below this limit are stored in memory, files above
this limit are stored on disk.

Format: 10 - 10 bytes
10k - 10 KB
10m - 10 MB
1g - 1 GB

uploadThresholdSize
1k


Set the path where the intermediary files will be
stored.

uploadRepositoryPath
/uploadLocation



...

Thank you very much in advance.
--
View this message in context: http://www.nabble.com/JSF-Tomahawk-File-upload-file-name-and-location-t1811443.html#a4936586
Sent from the MyFaces - Users forum at Nabble.com.



Do you Yahoo!?
Get on board. You're invited to try the new Yahoo! Mail Beta.

Reply via email to