Newbies monkjuice Posted July 2, 2010 Newbies Posted July 2, 2010 Hi, how do I reference images from a shared hosting server. Images are stored in a container field named imagecontainer. I created a calc field named testcontainer with "Calculation result as Container" and inserted in the calculation: Substitute ( imagecontainer ; "imagemac:/GV/media_database" ; "http://myserver.net/media_database" ) to rewrite the path to my hosting server where the image is located. The URL the field generates is correct. For testing purposes I created a calc field named testpath with "Result as Text" to output the path of my image container (field: testcontainer). If I right-click on the field testpath and choose "Open http://myserver.net/images/image01.jpg" the file on the hosting server shows up correctly in the browser. The problem is the container testcontainer that doesn't display the image referenced from the shared webserver at all. I still get 'The file cannot be found' even the path seems to be correct. What did I do wrong? Uli
Fenton Posted July 2, 2010 Posted July 2, 2010 A Container field (or calculation for one) does not use the "http://" syntax. A Web Browser object could. The container field uses more like what you started with: "imagemac:/GV/media_database/some image.jpg" This is assuming that "GV" is a mounted drive/volume (with OS file sharing on). If it is not (and cannot be) a shared volume, then you could use your first try, a web path calculation, for a Web Viewer. If you need a cross-platform path, you can either calculate the prefix and drive (as that's the only part that's different), or write 2 paths (one for Mac, one for Windows) on 2 separate lines (carriage return separated; ¶, that's Opt-7; just separating them by hitting a carriage return does nothing really; whitespace is ignored by the calculation engine). The multiple lines mean, to FileMaker, "try this one first, then this one, then this one...". Or, something like (off the top of my head, hopefully correct; I like the path up into smaller pieces, hence the Let() Let ( [ file_name = whatever FileMaker field has the name with extension; // file name.jpg folder_file_path = "media_database/" & file_name; // could get the folder path from a field sys_plat = Abs (Get (SystemPlatform)); // 1 is Mac, 2 Windows server_name = Case ( sys_plat = 1; "Mac server name/path"; "Windows drive/path"; ) // Mac & Windows may have different prefix = Case ( sys_plat = 1; "filemac:/"; "filewin:/" ) ]; prefix & server_name & "/" & folder_file_path )
Newbies monkjuice Posted July 2, 2010 Author Newbies Posted July 2, 2010 Thank you Fenton, hmm, I don't prefer the webviewer approach. In my scenario different people around the world should have access to view the images with FMP. Since I don't have a own server what would be the best solution? If I have a shared volume, in my case I turn File Sharing on in OS X to share a folder with all my images would that work? Or how else could I get a mounted volume for people to access it worldwide that are not in my network? Thank you. Uli
Recommended Posts
This topic is 5317 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