SoCalMacDude Posted June 29, 2011 Posted June 29, 2011 I can't seem to figure out the proper syntax for an unstored calculation field that gives me the always current file path to a supercontainer. David says there is an easy way to query it, but I can't see how to do it without simply providing it everything I already know - therefore I am not asking it, I'm telling it! Can give me a quick detail about that? Thanks.
Smef Posted June 29, 2011 Posted June 29, 2011 It's not a query, it's a calculation that you have to make. It can be anything that you want, but I recommend using databasename/tablename/recordID for your SuperContainer path. Your full url would be something like: http://myserver.com/SuperContainer/Files/databasename/tablename/recordID Keep in mind that the "path" used by functions is just the part after "Files" in your URL.
SoCalMacDude Posted June 29, 2011 Author Posted June 29, 2011 It's not a query, it's a calculation that you have to make. It can be anything that you want, but I recommend using databasename/tablename/recordID for your SuperContainer path. Your full url would be something like: http://myserver.com/SuperContainer/Files/databasename/tablename/recordID Keep in mind that the "path" used by functions is just the part after "Files" in your URL. Yes, I understand the path fully and completely. I just don't understand how to call it as you were describing yesterday. What, exactly, would my unstored calculation field look like? Can you give me an example?
Smef Posted June 29, 2011 Posted June 29, 2011 If you wanted to get the file information in an unstored calc you might make a unstored calc that looks like: SCGetInfo(table::path) You would want to make a stored calc for your path, which would look like "/databasename/tablename/" & table::recordID If you need a hand writing your calcs or scripts I can help you with the development in your database directly. Our rate is $165/hour.
SoCalMacDude Posted June 30, 2011 Author Posted June 30, 2011 If you wanted to get the file information in an unstored calc you might make a unstored calc that looks like: SCGetInfo(table::path) You would want to make a stored calc for your path, which would look like "/databasename/tablename/" & table::recordID If you need a hand writing your calcs or scripts I can help you with the development in your database directly. Our rate is $165/hour. Yes, I have that working fine. The SCGetInfo returns the 3 lines of information. If you look at my original question, you had told me on the phone that it is wise to have an unstored calculation that always tells you the entire path, including the file name of the file that's stored there, live and dynamic. I thought you said it used the SCGetFileURL ( macPath; winPath; folderPath ), however, I would expect that you could just get the generic "folderpath" and ignore the Mac & Win statements. Did you mean that you can take the supercontainer path, and add the filename to it in a calculation? Please explain.
Smef Posted June 30, 2011 Posted June 30, 2011 You should never, never, never, never, never use a filename as part of your path calculation. Your SuperContainer path is like the name of a field, and you should treat it the same way. I think you're confused about my recommendation. My recommendation is to use SCGetInfo in an unstored calc to get your filename, rather than using a text field and trying to parse it out in a script while you're scripting the upload of a file. You now have a calculation that uses scgetinfo, and it is returning the filename for you. If you want to to show only the filename you can use the filemake getvalue function to get the first line of the information that is returned. getvalue(scgetinfo(path); 1) will get you just the filename. Your path field should be a stored calculation, which calculates to /databasename/tablename/recordID. You can make a full URL calculation as well, if you want, which would just be the server URL & path field concatenated, giving you your full http://myserver.com/SuperContainer/Files/databasename/tablename/recordID which you could use in a web viewer.
SoCalMacDude Posted July 1, 2011 Author Posted July 1, 2011 Perhaps I did misunderstand your recommendation. The SCGetInfo has always been obvious to me - I certainly would not want to blindly store a filename, and rely on the hope it never changed. It totally makes sense that you would query the container for its current contents. I guess I thought you were doing it a different way. Thanks. So, if you look at the first post of this thread, the answer to my question is in your last post: My recommendation is to use SCGetInfo in an unstored calc to get your filename, rather than using a text field and trying to parse it out in a script while you're scripting the upload of a file. You now have a calculation that uses scgetinfo, and it is returning the filename for you. If you want to to show only the filename you can use the filemake getvalue function to get the first line of the information that is returned. getvalue(scgetinfo(path); 1) will get you just the filename. Your path field should be a stored calculation, which calculates to /databasename/tablename/recordID. You can make a full URL calculation as well, if you want, which would just be the server URL & path field concatenated, giving you your full http://myserver.com/...lename/recordID which you could use in a web viewer. Thanks for your help.
Recommended Posts
This topic is 5230 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