Jump to content

Auto-convert Word Docs uploaded with Supercontainer to PDFs


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

Recommended Posts

Hi everyone,

I'm having a big issue with Supercontainer that might have a quick and easy solution to it that I can't seem to figure out.

I have a supercontainer field that stores an uploaded Word Doc in one directory named /files/ID/Docs/.

Then, I have another supercontainer field that we currently upload a PDF version of the same Word Doc named /files/ID/PDFs/

The whole idea is to upload only the word document, and then hit a button in Filemaker that would then auto-generate the PDF version in the other folder. I guess I could get it done with AppleScript, but my concern is how would SuperContainer then realize that the PDF file is there when no one uploaded it to start with? It would basically just be in this folder that AppleScript would have created, with supercontainer not knowing what to do with it. Also, the RawData folder would not be generated?

How could I best approach this issue ?

Thanks!

Link to comment
Share on other sites

Hey DataCruncher,

As a "mini-experiment" if you will... Try creating a .pdf file (Test.pdf) on your host machine and create a new folder (ex: "TestCase") in your directory, which contains the SuperContainer files folder (by default this is: "/Users/Shared/SuperContainer/Files/"). In your case, you would probably end up having something like:

"/ID/PDFs/TestCase/"

NOTE: You generally want to follow the recommended: /databaseName/tableName/recordID/ paths for SuperContainer. By starting with ID here, you could run into some other conflicts if, for instance, you have another table that also utilizes IDs and IDs begin to overlap -- possibly overwriting data. So, instead of the above, you may want to use something like:

"/Employee/ID/PDFs/TestCase/"

as your URL. Now, drop your recently created .pdf file into that folder "TestCase". By doing this, you have just created a reference to that PDF file in SuperContainer, which is now accessible from anywhere and by anyone who has access to that server machine.

NOTE: This is just a mini-experiement and not the best thing to do... as you can run into some permissions issues. What you'll want to use instead after creating a new PDF is to move that PDF into the newly created folder using the SuperContainer companion plugin function: SCMove().

... to answer you plainly. You will want your "Create PDF" button to generate your PDF, create a new folder in your "/Employee/ID/PDFs/" directory, and then move that newly created .pdf file into the folder you created by use of the SCMove() function. So long as you create a valid folder path, then SuperContainer will be able to access that file, regardless of whether it was uploaded explicitly using the SuperContainer web viewer interface.

Unfortunately, it gets a bit complicated since I am assuming you will want to execute this AppleScript script on the server, in which case you will need something like RemoteScripter to trigger this script (to generate and move the PDF) server-side after a user client has uploaded the Word document.

Hopefully this gives you a general idea of how to approach this. If you need more information, it would probably be best if you could call into the office at the number below and speak to me or another developer directly to help you sort this out.

P.s. There is not a "RawData" folder... nor is there a "Files" folder. Both are simply protocols that SuperContainer uses to determine what type of file/format will be returned from the URL request. However, it can be misleading since the folder structure is similar on the local machine.

Regards,

Link to comment
Share on other sites

This topic is 4553 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.