2 Replies Latest reply on Dec 2, 2012 4:35 AM by brian.curran

    Filename for Files stored in container

    mmiesel

      Title

      Filename for Files stored in container

      Post

           Hello and thanks for reading this,

           I have a database with all data for all products I am selling. The pictures of these items I usually get in an excel table, and I simply drag & Drop it into the container field in my filemaker. They get stored openly somewhere else on my computer. (C:/Products/Pictures). That works already.

           The problem is, due to I take the pictures out of an excel table, they do not have a filename. So in my folder they all carry the same name "Untitled_XX". 

           Is there any way, to change the filename to the itemnumber (field in my database) or something? 

           I am trying this the whole day already, and could not find any information on the web.

           Thank You!

           Michael

        • 1. Re: Filename for Files stored in container
          ChristianSchmitz

               In our MBS Plugin we have functions like Container.Rename to change the file name of a container value. Also we have Container.Export where you can pass a file path and include the file name you like.

                

               Greetings
               Christian

                

          • 2. Re: Filename for Files stored in container
            brian.curran

                 Whenever one of our users wants to save a new file to a container field, we rename the file based on where it originated from before exporting it to an Archive folder. The following might help although you will have to deconstruct it to see how it works

                 Set Variable [$file; Value: C:/Products/Pictures/  & YourTable::ItemNumber & " ID: " & YourTable::PrimaryKey & " " & Day ( Get ( CurrentDate ) ) & "-" & Month ( Get ( CurrentDate ) ) & "-" & Year ( Get ( CurrentDate ) )  & " " & Hour ( Get ( CurrentTime ) ) & "-" & Minute ( Get ( CurrentTime ) ) & "-" & Seconds ( Get ( CurrentTime ) ) & " " & Substitute ( GetValue ( GetAsText ( GetField ( Get  ( ActiveFieldTableName ) & "::" & Get ( ActiveFieldName ) ) ) ; 1 ) ; "remote:" ; "" )]

                 Export Field Contents ["$file"]

                 After the export, you will need to write something that imports it back into the same location, maybe have it loop it through all your records?