You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by peter riegersperger <ri...@subnet.at> on 2003/01/22 20:50:25 UTC

file upload aborting

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

hi all!

i'm using the file upload service to upload moderately sized files (images, 
for web use).
i experience the following problem from time to time:
the action is executed, obviously until the file is at the server, because 
i've got temporary files (that are in fact the complete files i try to 
upload) in the webapp-home.
*but* the files should be written to a certain directory and given a specific 
name, and this is not working. i only got the temporary files, not the "real" 
ones.
additionally, execution of the action stops right after the line that tries to 
save the file.

my code looks like this:
   FileItem fileItem = data.getParameters().getFileItem("file");
            if (fileItem != null)
            {
//this is for getting the file extension            
StringTokenizer stringToken = new StringTokenizer(fileItem.getContentType(), 
"/");
            String FileType = null;
            while (stringToken.hasMoreTokens())
            {
                FileType = stringToken.nextToken();
            }
            String FileName = new String(entry.getID() + "." + FileType);

              
            
fileItem.write(TurbineServlet.getRealPath(Preferences.getStringValue("filepath") 
+ FileName));
            entry.setMediaPath(FileName);
             
            }

after this line, would be some things to do for turbine, but they are never 
done.

what do i do wrong?

thanks,

rick

- -- 
|-
| peter riegersperger  <ri...@subnet.at>
|-
| ein windows switcher tagebuch:
| http://forum.subnet.at/viewforum.php?f=22
|-
| subnet
| platform for media art and experimental technologies
|-
| http://www.subnet.at/
|-
| muehlbacherhofweg 5 // 5020 salzburg // austria
|-
| fon/fax +43/662/842 897
|- 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+LvYCIMP39JYOy9IRAuXuAKCAZuaL+/zuGTuAlkTjEkshAs5xRQCgvKbC
2BazNOCl+PRlVUEhEMkSsGI=
=JWLp
-----END PGP SIGNATURE-----


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