?
Solved

export images from container

Posted on 2006-11-30
14
Medium Priority
?
3,403 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 2000 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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

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…
Problem: You have a hosted FileMaker database and users are tired of having to use Open Remote or Open Recent to access the database. They say, "can't you just give us something to double-click on rather than have to go through those dialogs?" An…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

752 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