Solved

export images from container

Posted on 2006-11-30
14
3,386 Views
Last Modified: 2007-12-19
I have a filemaker 3 database that I converted to filemaker 5 format using Filemaker Pro 6 on Win XP.  I would like to convert the database to SQL Server.  I have no experience using filemaker....and from what I can see, the best way to do this is to recreate the schema in SQL server, export from fp to tab-text or csv, then import to ms-sql.  The only problem is one of my tables has a container field with image data.  How can I get the images out to the filesystem with referenced filenames?  Or if there is a better way, please let me know.  I know various scripting/programming languages (perl, java, c#).  I saw kind of a solution for doing this on a MAC here:

http://www.entropy.ch/blog/Mac+OS+X/2006/06/03/Exporting-Images-from-FileMaker-DB-fields.html

Thanks for your help.

Mike
0
Comment
Question by:RussSage
  • 8
  • 6
14 Comments
 
LVL 28

Expert Comment

by:lesouef
ID: 18047353
it is probably easier to do this with fm8 as filemaker cannot generate any filename.
let me check using an old fp3 or fp5 file and see how it behaves. I'll be back later on
0
 
LVL 28

Expert Comment

by:lesouef
ID: 18047518
I confirm, it's far easier to use fm8 to export images from a container with a relevant name automatically because there is now an export container field function which did not exist in v6 and you can work out a filename from other fields contents and then get a name which allows you to track and re-import the image in msSQL easily. let me know if you need more help
0
 

Author Comment

by:RussSage
ID: 18047963
I need more help.  Each record in my table has a GraphicID field and a GraphicContainer image container field.  How exactly do I use this export container field function to export all of the images to a directory with the GraphicID in the filename.   Also, I do not know what the image format is.  I only know that it is an image because I can copy/paste from the field into MS-Paint.  Thanks.
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 28

Expert Comment

by:lesouef
ID: 18048545
Telling you how to do is no pb, I can give you an example file, the script is 5 lines, not more; but guessing the file format is a problem:
if you export manually, it will put the extension automatically if under windows (did not test under osX), but the name is untitled as this is coming from fm3 and no filename exist in the container in this case. If you use my script, you either put no extension, or always use the same one, assuming you know the format and that it is the same for all images which is likely to be?
Is it a pb for you to use extensionless names for furthers steps in msSQL?
If you need them and if you have several formats, I would export them without extensions, use a photoshop script on a mac qui save the images with extension, and then change the database names accordingly. but this is quite a bit of work.
btw, are you /osX or /windows?
0
 

Author Comment

by:RussSage
ID: 18048954
I am on Windows.  When I do a manual export, it wants to give me a .pct file.  That's another problem entirely, because I will need to convert to a more generic format (like bmp or jpg).  Is there a way to force the images to come out in a specified format?  Otherwise I will have to figure out a way to do a bulk image convert.  Regardless, not having a file extension is not a problem.  Thanks.
0
 
LVL 28

Expert Comment

by:lesouef
ID: 18049016
no, it will come out the same as the original (macintosh pict).
and if all are the same format, you can have the .pct added automatically.
and bulk conversion can be done by photoshop easily. how many images is that?
0
 

Author Comment

by:RussSage
ID: 18053367
It's around 900 images, and I'm assuming they are all the same format.  I do have an older version of Photoshop 7.  I don't think the image conversion will be a problem.  The main problem for me is getting the images out of Filemaker.
0
 
LVL 28

Expert Comment

by:lesouef
ID: 18053443
pshop 7 can do that with no doubt, I still have a pshop v4 which does it.
if you don't have fm8, remember you can get a demo version for 30 days if you don't intend to buy it.
and I can give you the script to do it, I wrote it and it works
0
 

Author Comment

by:RussSage
ID: 18053498
Yes, please give me the script.  How do I run it?  Scripts -> Scriptmaker -> Import?
0
 
LVL 28

Expert Comment

by:lesouef
ID: 18053739
I have posted a sample file where you can check how it works, and then import the script to your file.
Change fields name accordingly in the script after import
http://www.carina-tm/upload/images_export.fp7
0
 

Author Comment

by:RussSage
ID: 18054977
I can't seem to figure out the filename part.  No matter what I try, I get the following error:

"-" could not be created on this disk.  Use a different name, make more room on the disk, unlock it or use a different disk.

This is what my current script looks like:

* Go to Record/Request/Page [First]
* Loop
*   Set Variable [$image; Value:"/*\"file:/\" & \"C:/temp/fm/\" & Get( GraphicID ) & \".pct\"*/"]
*   Export Field Contents [PTDGraph::GraphicContainer; "$image"]
*   Go to Record/Request/Page [Next; Exit after last]
* End Loop

The directory exists.  Can you see what I'm doing wrong?

0
 
LVL 28

Accepted Solution

by:
lesouef earned 500 total points
ID: 18055060
the variable is wrong:
Set Variable [$image; Value:"/*\"file:/\" & \"C:/temp/fm/\" & Get( GraphicID ) & \".pct\"*/"]
should be:
Set Variable [$image; Value:"file:/" & "C:/temp/fm/" & Get( GraphicID ) & ".pct"]
If you have any doubt, as a test, use a custom dialog command to display $image before executing; you'll then be able to see if the path makes sense:
show custom dialog ["image path" ; $image ]
0
 

Author Comment

by:RussSage
ID: 18055541
Ok, I got the images out.  I didn't like the Get() function.  Here is the final working script.

* Go to Record/Request/Page [First]
* Loop
*   Set Variable [$image; Value:"file:/" & "C:/temp/fm/" & PTDGraph::GraphicID & ".pct"]
*   Export Field Contents [PTDGraph::GraphicContainer; "$image"]
*   Go to Record/Request/Page [Next; Exit after last]
* End Loop

Thanks for your help.

0
 
LVL 28

Expert Comment

by:lesouef
ID: 18055577
I used the recordID because I did not know which field you wanted to use, I don't have yr database!
This way I was sure it was gonna work since recordID is always valid.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Pop up windows can be a useful feature of any Filemaker database.  Though best used sparingly, they can be employed in a multitude of different ways, for example;  as a splash screen at login, during scripted processes to control user input, as pick…
Conversion Steps for merging and consolidating separate Filemaker files The following is a step-by-step guide for the process of consolidating two or more FileMaker files (version 7 and later) into a single file with multiple tables. Sometimes th…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

815 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now