FM_n00b Posted June 17, 2009 Posted June 17, 2009 (edited) hi all, i am terribly new to filemaker so my apologies for the easy question, but here goes: I have a database with one of the fields being a four-letter code that associates with a plant species. i have two images for each species, whose filenames are the value of the code field with a 1 or a 2 appended, eg for the record with Code "BIBE" i have BIBE1.jpg and BIBE2.jpg I would like these images to remain external to the database file and need them to appear in each record. I have a calculation field with output set to container with the following calculation: "file:"&Code&"1.jpg" all that shows up with this is a missing image picture, with the correct filename below it. the jpg's are in the same folder as the database, although i am considering moving them to /img/ any help would be appreciated! Edited June 17, 2009 by Guest
bcooney Posted June 17, 2009 Posted June 17, 2009 (edited) Very close. You would need the full path to the file. As you say, your images are loose in the same folder as the FM file (which you should probably change to the subfolder idea) For your first image, in field Image1, calc, result container: "imagewin:" & Get (Filemakerpath) & table:Code & "1.jpg" or "imagemac:" & Get (Filemakerpath) & table:Code & "1.jpg" The easiest way to see the actual path is to insert one manually as a reference, and view the container field as text. It'll have the full path as the second value. Edited June 17, 2009 by Guest
FM_n00b Posted June 17, 2009 Author Posted June 17, 2009 thanks for your reply, i will have to try this tomorrow when i am back at work. would this work on a server? i have FM server 10 advanced and plan on hosting the database through that, but i am testing the database on my pc for now, so i will eventually move all of these files there. also, if the server is running windows and is hosting the db via IWP, PHP etc would it still work? even if a mac user visited the site or remotely opened the file? thanks again!
FM_n00b Posted June 18, 2009 Author Posted June 18, 2009 "imagewin:" & Get (Filemakerpath) & table:Code & "1.jpg" this doesn't work for me because it points to the directory that filemaker is installed in. my database isn't in that folder, is there a way to reference a folder that is relative to the database file? i see the Get(FilePath) function but it's path includes the actual filename (in this case WMI.fp7) is there a way to truncate this path by the 7 characters needed to be removed?
Genx Posted June 18, 2009 Posted June 18, 2009 Let( [filepath = Get(FilePath); imagename = "yourimagename.jpg"]; Substitute( Left( filepath ; Position ( filepath ; "/" ;0 ; PatternCount (filepath ; "/" ) ) ) ; "file:" ; "imagewin:" ) & imagename ) Replace yourimagename.jpg with whatever the filename is or whatever calc you use to establish the filepath
FM_n00b Posted June 18, 2009 Author Posted June 18, 2009 awesome! thank you very much, worked like a charm. now to try to decipher it so i can understand how it works lol
Genx Posted June 18, 2009 Posted June 18, 2009 (edited) You're welcome : Look at the documentation for the following functions individually: Position -> Determines location of a particular occurrence of a particular character in a string or part of a string. PatternCount -> Determines total number of a particular character in a string Substitute -> Replaces specified text in a string with another piece of text. You can go without the let though all it does is essentially sets temporary values to be references in the calculation. Edited June 18, 2009 by Guest
bcooney Posted June 19, 2009 Posted June 19, 2009 "also, if the server is running windows and is hosting the db via IWP, PHP etc would it still work? even if a mac user visited the site or remotely opened the file?" You would need to store the image files on the web server, and store the url reference to the image in the record. Then php would use the url to display the image.
FM_n00b Posted June 22, 2009 Author Posted June 22, 2009 just how do i do that? i have uploaded the database and all of the images to the server and the references to the images are stored as: "imagewin:/C:/Users/GIS4/Desktop/filemaker pro files/WMI/img/BRSC1.jpg" how do i make the server able to display the images through network sharing, IWP, etc?
bcooney Posted June 24, 2009 Posted June 24, 2009 Also, read pp. 19-20 in http://www.filemaker.com/downloads/pdf/fms10_cwp_php_en.pdf
Recommended Posts
This topic is 5629 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now