• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3411
  • Last Modified:

export images from container

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
RussSage
Asked:
RussSage
  • 8
  • 6
1 Solution
 
lesouefCommented:
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
 
lesouefCommented:
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
 
RussSageAuthor Commented:
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
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

 
lesouefCommented:
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
 
RussSageAuthor Commented:
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
 
lesouefCommented:
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
 
RussSageAuthor Commented:
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
 
lesouefCommented:
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
 
RussSageAuthor Commented:
Yes, please give me the script.  How do I run it?  Scripts -> Scriptmaker -> Import?
0
 
lesouefCommented:
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
 
RussSageAuthor Commented:
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
 
lesouefCommented:
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
 
RussSageAuthor Commented:
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
 
lesouefCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

  • 8
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now