• Skip to main content
  • Skip to primary sidebar
  • Skip to footer

1stplugins

FileMaker plug-ins and Reverse Engineering

  • Plugins
    • MediaManager
  • Services
    • Reverse Engineering
    • FileMaker Plug-Ins
  • About
    • About Us
    • Contact Us
    • Terms of Use of the Website and Privacy Policy
  • Store
    • Terms and Conditions
    • Warranty Claim Guidelines
    • Contract Withdrawal Form
    • Warranty Claim Report

Media_InsertFile

Media_InsertFile ( filepath ; byReference ; asText )

Media_InsertFile inserts a file directly or by reference into a container field. You can also insert a file’s text into a text field.

Parameter Description
filepath

a full file path, or partial file path that picks up with the default path. If the source is a reference, then the destination can be a path to a folder; otherwise, it must be a path to a file.

The filepath parameter can be:

  • file path
  • text field with a file path
  • file URL
byReference “1” or “True” to store by reference; “0” or “False” to store in container field.
asText “1” or “True” to insert only the file’s text into a text field; “0” or “False” to insert the entire file into a container field.

Media_InsertFile gives you the ability to quickly and easily insert files of any type (even other FMP databases) into a FileMaker container. As with an image, the inserted file can be stored directly in the container or as a reference.

This function can also insert the contents of text files directly into text fields.

The filepath parameter can also be a URL, giving you the ability to insert the text web pages, giving you the ability to store and catalog the HTML of favorite web pages. And, if you want, you can then use FileMaker’s built-in text parsing functions to isolate specific information – image or link URLs, new posting dates, updated stock information, etc.

For example, if you want to grab the HTML text of a file named “new.htm” located in the http://www.MySite.com/ directory, you can use a script step:

Set Field [ MyTable::HTML Text ;
Media_InsertFile (
"http://www.MySite.com/new.htm" ;
False ;
True
) ]

(View the demo files for in-depth examples of how to do this.)

Examples

To insert “customerltr.doc” into a container field named Container using a hardcoded filepath:

Set Field [ MyTable::Container ;
Media_InsertFile (
"/c:/documents/customerltr.doc" ;
False ;
False
) ]

To insert a file named “tester.fmp12” into a container field by reference named Example:

Set Field [ MyTable::Example ;
Media_InsertFile (
"tester.fmp12" ;
True ;
False
) ]

To insert the text of a file named “notes012606.txt” into a text field named Notes:

Set Field [ MyTable::Notes ;
Media_InsertFile (
"notes012606.txt" ;
False ;
True
) ]

To allow the user to select a file to be inserted by reference:

Set Field [ MyTable::FileName ;
Media_SetDefaultFolder (
".V:Select the file to insert"
) ]

Set Field [ MyTable::Container ;
Media_InsertFile (
MyTable::FileName ;
True ;
False
) ]

Primary Sidebar

Document Functions

Media_CopyItem
Media_CreateAlias
Media_CreateFolder
Media_DeleteItem
Media_ExportField
Media_ExtractInfo
Media_GetDefaultFolder
Media_GetItemInfo
Media_GetName
Media_GetPath
Media_InsertFile
Media_ListDisks
Media_ListFolder
Media_MoveItem
Media_OpenItem
Media_RenameItem
Media_Search
Media_SetDefaultFolder

General and Registration Functions

Media_Get
Media_GetLastError
Media_GetMouseUp
Media_JSONPath
Media_PeekStream
Media_Register
Media_RegisterLicensedEncoder
Media_Set
Media_Version

Image Functions

Media_ConvertImage
Media_CreateQRCode
Media_EffectApply
Media_EffectDialog
Media_GetImageInfo
Media_GetMetadata
Media_InsertImage
Media_ListImageOutputTypes
Media_SetImageDefaults Media_TApply
Media_TClear
Media_TCrop
Media_TQuad
Media_TResize
Media_TRotate
Media_TScale
Media_TSkew

Script Steps

Copy Item
Create Alias
Create Folder
Delete Item
Export Field
Get Default Folder
Get Item Property
Move Item
Open Item
Rename Item
Set Default Folder

Sound Functions

Media_Amplify
Media_AppendSound
Media_ConvertSound
Media_CreateSound
Media_DrawWaveform
Media_ExtractSound
Media_FadeSound
Media_GetMetadata
Media_GetSoundInfo
Media_InsertQuickTime
Media_ListSoundOutputFormats
Media_MixSounds
Media_Normalize
Media_PlayPause
Media_PlaySound
Media_RecordSoundFormatDialog
Media_RecordSoundStart
Media_RecordSoundPause
Media_RecordSoundStop
Media_SetMetadata
Media_SoundFormatDialog
Media_StopSound

Video Functions

Media_GetVideoInfo

Footer

Let’s get started on your project.

Get in touch

  • Plugins
  • Services
  • About
  • Store

Copyright ©2006-2020 by 1stplugins, s.r.o. All rights reserved.