This image looks alright to me. If you open up same PDF in FileMaker Pro is it same file then?
I have the exact same problem :-(
I have no experience, but found a workaround that edit /etc/hosts here. Re: WebDirect Export field contents for container field fails
Have you tried this?
If you use WIndows, the file is %windir%\system32\drivers\etc\hosts
i cleaned up the Container content as per http://help.filemaker.com/app/answers/detail/a_id/14200/session/L2F2LzEvdGltZS8xNDc0NDIzNDg3L3NpZC9jN05NSDhfbQ%3D%3D.
It now works as required allowing to SAVE AS and allowing to select Folder required.
I also used PHP script to view document when clicked. Please find below for anyone needed,
Document.php (Bridging script)
Just to note, this works when I Insert File to container from Desktop Version, not via Web-direct. However you can view well from Web-direct.
For Files inserted from Web, it gives PHP Catchable fatal error: Object of class FileMaker_Error could not be converted to string in Document.php on line 41 Error.
Any thoughts, suggestions?
There is no error handling code around the line 41. If $fm->getContainerData() returns FileMaker_Error object, it can't be "echo" ed. then you got the error message.
1 of 1 people found this helpful
I use the below script. On WebDirect, the download location is your default downloads location, and you can't change it.
The Set variable full calculation is:
Case ( Abs (Get(SystemPlatform) ) = "2"; "filewin:" ; "filemac:" ) & Get ( DocumentsPath ) & GetContainerAttribute ( YourTable::ContainerField ; "filename" )
I found this from David Head on a different thread:
"FWIW it is important to understand that FileMaker WebDirect is a web app. It operates in a sandbox. As such it has no access to your filing system. So that is why it will ignore every file path directive and export to where the browser directs it."
This is extremely helpful, thanks. The only issue is that I end up with a file with a "?" as the name and no file extension. I did alter the script to reflect my computer and project - and it downloads correctly and opens; but can you please tell me where in the script I have failed? Thanks very much.
It looks you failed at getting filename from GetContainerAttribute() function, but you could download the file... Do you use latest FMS and which browser?
The calculation returns invalid path for webdirect, starting "filemac:". I prefer using only
GetContainerAttribute ( YourTable::ContainerField ; "filename" )
Can you post a screenshot of your script?
Well, yep, that's where the trouble is. The command, GetContainerAttribute will return all sorts of information, but you have to specify what it is that you want. The available options can be seen at: GetContainerAttribute
In my example, I was specifying: "filename". You're trying to specify "edma", but that's not an attribute that's available.
By setting the variable as it is being set, you're selecting the path AND the filename. What is edma? Is that the same class name for all students?
You can have a field in the database which gives a meaningful name,
// Get the title of the record
$title = $record->getField('Document_Name');
Following calculation will extract the name of the File uploaded to Container.
In above case,
Document_Name field is 'GetContainerAttribute ( Document ; "filename" )'
where Document is the Container Field.