Jump to content
Server Maintenance This Week. ×

Existing Container Data Preview Not Working


This topic is 3818 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Just finished migrating existing container data (PDFs, Word Documents) from one table where the data was stored within the fmp12 file.  I created a new table along with a new container field which was configured to use external storage so I would not inflate my main db file with all the container data.  

 

The import went fine all container data moved over successfully and is now being stored securely externally.  On my layout I have the container field configured to show the PDF in an interactive viewer. All new document inserted into the container field preview correctly, however all old data which was imported only shows the icon.  The only method I could do is to export the container data and re-insert it which seems to be kind of backwards.  Has anyone run into this or know a work around with writing a script to export and re-insert all container data?  

 

EDIT: I have triple checked to ensure Optimize for Interactive content is enabled with Start Playback automatically.  

 

My data set is approximately 11k records.

Link to comment
Share on other sites

I am not an expert, but my research on related Managed Storage & container fields lately leads me to think that you will have to re-import all of the files in order for previews to work properly.

 

Assuming your solution is not too complex, this should not be hard to do. Something like this, although you will need to adjust the directory & file name calcs.

 

(script steps)

Go to First Record

Loop

Set Variable [ $export_file_name; Table1::calc_New_File_Name ]

Export Field Contents [ Table1::OriginalContainer ;  "/Temporary/$export_file_name" ]

Insert File [ Insert; Display Content; Never compress ; Table1::NewContainer ; "/Temporary/$export_file_name" ]

Go to Next Record [ Exit After Last ]

End Loop

Link to comment
Share on other sites

Thx Gilbert.  I came up with a solution very similar to yours.  I just had to account for Word docs which are stored but cannot be previewed.

 

Using pattern count I check to see if the specified container field contains the string "File:"  This seems to be the old method files are stored using prior to the conversion. When the preview field is functioning on PDFs it returns the string "PDF:" when evaluated. 

 

If it finds it - I export and re-import the field.  The script checks for this and will ignore anything which is already previewing properly.

 

Granted, this only check for PDFs since we do not store any images in these fields.  We do store word docs as well, so I used conditional formatting to show a button when the container field evaluates as ".doc" so the user can preview the file in Word by exporting to a temp path.

 

Seems to be working ok.

 

I hope this makes sense to anyone else who might be stuck with this.

Link to comment
Share on other sites

This topic is 3818 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.