Jump to content
Dubosky

Image upload by users

Recommended Posts

Dubosky

Hi all,

 

I've just started to develope with Filemaker (v7) and I'm facing a question that I don't know how to solve.

 

We have a database where the records of one of the tables can have associated images, currently stored in containers (NOT as reference).

 

As the DB will grow fast, I want to store the files by reference in a shared network folder. The process will be like this:

 

1. The user navigates to a register and decides to upload an image.

2. A "locate file" dialog should be shown to let the user choose the file.

3. The file is copied to the shared network folder, changing the name of the file to the unique ID of the image + original extension. And the reference to the shared file is stored in the database.

4. The user can of course download the original file any time later.

 

- Is it possible to copy images from the client to a shared network folder without plugins? (thought about importing to container, exporting to server and then reimporting as reference)

- If the location of the files may change sometime in the future... how to update all the references? For this matter... isn't it better to store only a path in a text field and then use some kind of "Open Url?"...

- How can I export the images currently in container fields? I didn't seem to be able to dinamicaly specify the name of the destination file in the "Export Field Contents[]" script step.

 

We mainly work in Mac (though I would like to make the solution cross-plattform)... and maybe we will update to FM 9 in the near future (if this would help). I never worked with Mac before, so I don't know AppleScript... but I guess that as a programmer it shouldn't be a problem to learn a bit.

 

Any hints?

 

Thanks in advance!

Share this post


Link to post
Share on other sites
progress

Hello everyone. I am new here and on the eve of purchasing FMP11 Advanced and begin developing my DB.

 

I stumbled across this OP and think it is a great and legitimate question.

 

Central storage for related database documents, images, etc. and the most intuitive method for a user to access them and upload them into the database.

 

I will continue my search for other FMP developer solutions to this issue, but I figured this is the best place to begin. Thank you.

Share this post


Link to post
Share on other sites
AHunter3

Sure!

 

a) Have the end users upload their image or file into the container field (NOT as a reference) as part of a scripted process: Insert Picture or Insert File.

 

b) Script continues, executing an Export Field Contents to a $Variable as the export path; the $Variable is first set to a calculated value consisting of "filemac:" ( or "filewin:") & path/to/the/server/folder/subfolder/ & UploadedFileName, doing this with NO DIALOG

 

c) Having done so, the script does a Set Field of the container field to that same path; when a Set Field script step sets a container field to a file path, the result is that that path is stored "as a reference" to an external file. Thus, you've now replaced the actual uploaded file (or image) with a reference to a file stored on the file server, which you just placed there by exporting it to that location.

 

d) To accomodate cross-platform issues, you can have a DISPLAY field, an UNSTORED calculation field of result type "container" which checks for Abs (Get (SystemPlatform)) and compares it to the starting string of the stored file path; if the latter is "filemac" and the Abs of current user platform is 1, OR if the latter is "filewin" and the Abs of current user platform is 2, the DISPLAY field = the container field, plain & simple; if they are a mismatch, the DISPLAY field substitutes the platform and, where necessary, changes parts of the path/to/the/server to reflect the different ways that network resources can be shared to Mac and PC environments. (e.g., it might be the Z: drive for PCs and might be mounted on Mac user's desktops as ServerVolumeOne or some such thing).

 

e) To accomodate images, which have now been exported as FILES, the DISPLAY field can simply subsitute "image" for "file" at the beginning.

 

 

 

The only drawback of the above method is additional bandwidth & time used in uploading file into container field only to delete it after exporting it bacfk out. But if that isn't a dealbreaker in your environment, this will work and requires no plugin.

Share this post


Link to post
Share on other sites



×
×
  • Create New...

Important Information

Terms of Use