|
| [WB20] Where to store graphics & Pictures |
| Iniciado por guest, 13,feb. 2016 05:50 - 6 respuestas |
| |
| | | |
|
| |
| Publicado el 13,febrero 2016 - 05:50 |
Hi everyone -
I have an app that is actually made up of many WebDev applications. I simply jump from one to the next as need be. I'm having a problem around how to store graphics and pictures. The typical way I was told to do it is to save them using "FolderWeb()" - I think that's what it's called, but that locates under the particular project. When I jump to another project, they are no longer stored within that new project. I use the SCM to "share" pages between projects - so I need my "save or retrieve an image" page to look somewhere outside the project. Any ideas? |
| |
| |
| | | |
|
| | |
| |
| Publicado el 13,febrero 2016 - 06:44 |
Joel, In you case I would advise you to store all your graphics in a predefined hard coded location on your server. So irrespective of your project all the graphics will get save to that hard coded folder.
Another way is to store all the graphics as blob in the database and retrieve them as needed. But this will bloat the size of your DB very quickly if you have huge number of graphics.
HTH
Yogi Yang |
| |
| |
| | | |
|
| | |
| |
| Publicado el 13,febrero 2016 - 16:07 |
Hi Yogi and thank you!
I'd like to take the "blob" approach but don't really know how. I don't think there will be that many images. But I've been told that I'll have "permission and rights" problems if I try to store the pictures in another directory. Any thoughts on that? Also - I get confused about the functions for storing and retrieving the images from the database and using them. Which functions serve this purpose? |
| |
| |
| | | |
|
| | |
| |
| Publicado el 14,febrero 2016 - 13:22 |
Hi Joel
If you have a DB that is shared between your applications, then the easiest way is definitely to store the images inside the DB.
For that, I would advise that you create a new file (MyFiles, by example), with a record containing: - unique ID - Name of linked file (if necessary) - ID of linked record in linked file (if necessary) - Binary Memo field (to store your files)
THen just do a hlinkmemo+hadd to store a file, and read the record then do a hextractmemo to extract it. You can also directly use the binary memo field in siome situation without extracting it on disk
Best regards |
| |
| |
| | | |
|
| | |
| |
| Publicado el 15,febrero 2016 - 22:23 |
Great Fabrice! I'll follow your lead. Thank you! Although I still don't quite understand what hlinkmemo does. It seems to be an extra step from saving most any other field on information. I keep reading the help info, but it just doesn't sink in.
Any suggestion on how to tag the pics? Some will be student photos, others clip art that will be used for this or that. I'd love to be able to narrow down the choices the user sees based on what he's doing at the moment. I can think of a bunch of ways, but don't know what's most efficient.
Thanks again - hope all is well!
J |
| |
| |
| | | |
|
| | |
| |
| Publicado el 16,febrero 2016 - 15:35 |
Hi Joel
hlinkmemo: - reads the file from the disk/directory specified - store it in the binary memo field - also store in it the file name and a set of information about it
hExtractmemo: - read the content of the binary memo field - write the corresponding file on disk in the desired directory
As for tagging the pics, if you my ide of filename+main record ID in each binary memo record, then it's already done. Anything that is linked to a student is linked to it's student record FIleName+ID Anything that is linked to a studio is linked to the studio record FileName+ID
So basically, you link any file/picture to any record in your DB, any way you want
Best regars |
| |
| |
| | | |
|
| | |
| |
| Publicado el 16,febrero 2016 - 22:45 |
That's great! Thank you! I'm going to sit and code this now.
You da best!
J |
| |
| |
| | | |
|
| | | | |
| | |
|