Neil,
If you want to save the byte array, save it into the database, then just write
a caching proxy that maps a URL to the dispatcher. That is, use
SoftReferenceCache to cache the database read so that the next time the image
is requested there is no database hit.
This has been discussed a
Tim,
I'm not clear that how to do use the caching proxy and maps a URL to
the dispatcher.
I didn't find the archive about the SoftReferenceCache.
Is there some exmaple that descript how to use is ~?
:)
Thanks very much!
Cheers,
Neil
On Nov 15, 6:33 pm, Timothy Perrett
It try to deploy the war to the tomcat5.5.25, and the path is
different.
Use LiftRules.getResource(/images/) to get this information:
In the dev box:
-- Path:Full(file:/G:/project/demo/src/main/webapp/images/
In the tomcat:
-- Path:Full(jndi:/localhost/demo-1.0/images/
The
Where is the images directory that should i create ?
Out side of the webapp in the tomcat or in the webapps?
like this: D:\tomcat_5.5.25\webapps\images
And the lift how to know and find the images folder in the webapps
of the tomcat, not the demo/src/main/webapp/images .
Thanks
Neil,
Try something like:
var buff = new java.io.BufferedInputStream(input)
try {
var fos = new java.io.FileOutputStream(new File(/some/root/
filepath/ + image_hash_filename))
var in = 0
do {
in = buff.read()
if (in != -1){
fos.write(in)
}
} while((in != -1))
fos =
It show this error message:
ERROR - java.io.FileNotFoundException: \images\003.jpg
# this is the code
val receiptOk = fileHolder match {
case Full(FileParamHolder(_, null, _, _)) = true
case Full(FileParamHolder(_, mime, name, data))
if mime.startsWith(image/) = {
var buff
Hmm, I guess you must be new to the JVM - you cant write a file inside a WAR
file; it does not work like that.
You'll need to write to a fully qualified path (as per my example).
Cheers, tim
On 14 Nov 2009, at 17:34, Neil.Lv wrote:
It show this error message:
ERROR -
Tim,
haha, yeah.
I use this code to get the images folder(the full path) of the app.
LiftRules.getResource(/images/).open_!.toString.substring(6)
(The code is so redundant !)
- G:\project\demo\src\main\webapp\images\
:)
Thank you very much !
Cheers,
Neil
On Nov 15, 1:50
I really, really would not use open_! - this is very dangerous.
How about:
LiftRules.getResource(/images/).map(_.substring(6)).openOr(/some/
default/path)
Cheers, Tim
On Nov 14, 6:25 pm, Neil.Lv anim...@gmail.com wrote:
Tim,
haha, yeah.
I use this code to get the images folder(the
On Sat, Nov 14, 2009 at 10:25 AM, Neil.Lv anim...@gmail.com wrote:
Tim,
haha, yeah.
I use this code to get the images folder(the full path) of the app.
LiftRules.getResource(/images/).open_!.toString.substring(6)
(The code is so redundant !)
-
Hi all,
Thanks for your tips, and I have some silly question about this.
1:) a directory that's not part of the app's exploded WAR file
The direcotry tree like this, and Where is i can create a well
defined directory
that's not part of the app's exploded WAR file ? I'm not
I want to save the images to a directory, because this images will
be used in the flash params.
This file path will be used in the javascript code .
###
var imag=new Array();
imag[3]=/images/01.jpg;
###
Cheers,
Neil
On Nov 15, 12:05 pm, Neil.Lv anim...@gmail.com wrote:
Hi all,
The file not found error may be because the directory doesn't exist. Try
calling file.mkdirs first.
-
Neil.Lvanim...@gmail.com wrote:
I want to save the images to a directory, because this images will
be used in the flash params.
This file path will
13 matches
Mail list logo