-
1. Re: Rich:fileUpload - Get original/source file path
nicog Jun 16, 2009 4:31 AM (in response to nicog)sorry I clicked submit instead of preview:
the rest of the message:
I tried createTempFiles with true and false values (of course using respectively getFile() and getData() to get content) but the file path is always trimmed
Do you have any clie on this
Many thanks in advance for your answer -
2. Re: Rich:fileUpload - Get original/source file path
nimo22 Jun 16, 2009 6:49 AM (in response to nicog)Hello,
try to use:
File.getPath() /getAbsolutePath() -
3. Re: Rich:fileUpload - Get original/source file path
nicog Jun 16, 2009 6:59 AM (in response to nicog)Hi,
Thks for your answer
but already tried that
This is returning the path of the created temporary file..
Any other idea or suggestion?
Thanks -
4. Re: Rich:fileUpload - Get original/source file path
nicog Jun 16, 2009 7:01 AM (in response to nicog)I am NOt using uploadData..
would uploadData solve this?
thks -
5. Re: Rich:fileUpload - Get original/source file path
nbelaevski Jun 16, 2009 8:13 AM (in response to nicog)Hi,
That depends on what information browser sends; some browsers use full path, some just full name. We cannot fix that. -
6. Re: Rich:fileUpload - Get original/source file path
nicog Jun 16, 2009 8:32 AM (in response to nicog)Thks Nick
After digging on what you said, you are absolutely right.
This could be a implementation of specification but browsers justify not to do this due to security reasons..
Thanks -
7. Re: Rich:fileUpload - Get original/source file path
nimo22 Jun 16, 2009 2:16 PM (in response to nicog)Can this be the reason, why uploaded temp-files cannot be deleted?
// delete uploded files boolean a = item.getFile().delete(); log.info("deleted #0", a);
my log always returns: deleted false. So no files are deleted. -
8. Re: Rich:fileUpload - Get original/source file path
nbelaevski Jun 16, 2009 6:41 PM (in response to nicog)No, files should be deleted ok. Is there anyone blocking it?
-
9. Re: Rich:fileUpload - Get original/source file path
nimo22 Jun 17, 2009 1:28 PM (in response to nicog)yes someone is blocking it,
1. I upload the file,
2. the file is in the temp folder (in this state file.delete() works!).
3. I store the file into the database (blob)
3. and after successfully inserting, I want to delete the file in the temp folder
(in this state file.delete() does not work, as someone is blocking it..maybe my database?).