Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
7
Erster Beitrag:
vor 2 Jahren
Letzter Beitrag:
vor 2 Jahren
Beteiligte Autoren:
Joel, Fabrice Harari, Yogi Yang

[WB20] Where to store graphics & Pictures

Startbeitrag von Joel am 13.02.2016 04: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?

Antworten:

Re: [WB20] Where to store graphics & Pictures

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

von Yogi Yang - am 13.02.2016 05:44

Re: [WB20] Where to store graphics & Pictures

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?

von Joel - am 13.02.2016 15:07

Re: [WB20] Where to store graphics & Pictures

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

von Fabrice Harari - am 14.02.2016 12:22

Re: [WB20] Where to store graphics & Pictures

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

von Joel - am 15.02.2016 21:23

Re: [WB20] Where to store graphics & Pictures

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

von Fabrice Harari - am 16.02.2016 14:35

Re: [WB20] Where to store graphics & Pictures

That's great! Thank you! I'm going to sit and code this now.

You da best!

J

von Joel - am 16.02.2016 21:45
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.