-
1. Re: Display an image with a Blob
sysuser1 Jun 29, 2004 11:15 AM (in response to sysuser1)With
<img="">
or not? -
2. Re: Display an image with a Blob
jae77 Jun 29, 2004 11:39 AM (in response to sysuser1)the image is just stored as a blob in the database. if you wish to use it on an html page, you declare it the same way you would any other image using the img tag and the proper path to where the image is located.
-
3. Re: Display an image with a Blob
sysuser1 Jul 1, 2004 5:04 AM (in response to sysuser1)Ok but, in the module html you can upload a file (like an image -> pn_content_type : image/gif) and you can display it using its id (pn_fid in the nukes database) with the tag . "myImage" being the id.
How can you do that???
Can you help me? -
4. Re: Display an image with a Blob
sysuser1 Jul 1, 2004 8:21 AM (in response to sysuser1)I'm so sorry, I forget the tag each time !!
<img src="nukes/myImage">
-
5. Re: Display an image with a Blob
julien1 Jul 1, 2004 8:54 AM (in response to sysuser1)why not use the HTML module itself to store these files by using a dedicated folder for that.
you can create insert files in the file tree by using the HTML commands that have been introduced recently. Look at the FilePlugin for the HTML module which does that.
then you can access your content with URLs like /a/b/c -
6. Re: Display an image with a Blob
sysuser1 Jul 1, 2004 9:59 AM (in response to sysuser1)Yes, I have seen...
It works fine.. but I want to do the same thing with my own module.
So I succeed to store my image in my own database (thanks to you !!) and now, I would like to display my image.
I have looked at html module (+class Resource, ResourceManager, BLOBResource,...) and I don't understand how you can display a image only with its id !
Could you help me Julien? -
7. Re: Display an image with a Blob
julien1 Jul 1, 2004 11:26 AM (in response to sysuser1)when you request /modules/toto/a/b/c.gif, the module toto will have a request to return the resource "/a/b/c.gif".
so when you handle the resource for /a/b/c.gif you need to return that. -
8. Re: Display an image with a Blob
sysuser1 Jul 2, 2004 4:05 AM (in response to sysuser1)Ok, I tried to do it... but it doesn't work...
I look at your code...
You say :/** * Here we intercept the request and if the operation is userdisplay * and the file is not text, we stream it. */
I do, in my theme (because I want to display my image in my theme) :File myFile = new File(idMyFile,nameMyFile,typeContent, content, idUser, date); ResourceManager resManager = new ResourceManager(); resManager.start(); resManager.setMaxCacheSize(15); resManager.add("idImage",(Resource)myFile); Resource res = resManager.get("idImage"); //useless, I know, I can do a cast like (Resource)fic; ResourceResult resultat = new ResourceResult(res); NukesResponse resp = NukesLocator.getResponse(); resp.setResult(resultat);
I have to do errors because it doesn't work, but I don't know how to do.
Please help me !!! :o( -
9. Re: Display an image with a Blob
sysuser1 Jul 5, 2004 9:04 AM (in response to sysuser1)I found several errors in my prior code...
I have corrected them. But it's doesn't work !!
Julien, could you help me ? I don't know how to do ! Thanks a lot !
There is the code in my theme, to display my image with the URL "http://myserver/nukes/idImage".File myFile = new File(idMyFile,nameMyFile,typeContent, content, idUser, date); // I add my file in the resourceManager resourceManager.add("idImage",(Resource)fic); Resource res = getResource("idImage"); ResourceResult resultat = new ResourceResult(res); NukesResponse resp = NukesLocator.getResponse(); resp.setResult(resultat);
-
10. Re: Display an image with a Blob
sysuser1 Jul 6, 2004 4:17 AM (in response to sysuser1)It's ok, I do a module, and I can display my image via this module.
However, when I update my database, I reload my object (Blob) but my image isn't update in my page...
Someone can me why?