Jamroom Logo Jamroom 5 Core
is now Open Source!
Follow Jamroom on Twitter!


isMediaFile Function Index jrMediaDeleteFile
jrMediaGetFile

The jrMediaGetFile function is a general purpose function for retrieving an uploaded media file from a module, and making sure it is copied to the proper profile media directory.

  • return: returns true on success, false on failure
bool jrMediaGetFile (string $module, string $file_name, [int $media_id = 0], [int $band_id = false])
  • string $module: Module name
  • string $file_name: FORM file name
  • int $media_id: Media ID to store item as
  • int $band_id: Band_ID
 Comments
Brian, 11/13/09 16:35:13:

The jrMediaGetFile() function is going to be the main function you want to use when developing a module if you want to handle file uploads from the user (i.e. images, files, whatever). Some clarification:


  • $module - must be the name of your module directory - i.e. if your module is located at jamroom/modules/YourModuleName, then this would be "YourModuleName".
  • $file_name - this must be the FORM name you have given to the file upload text file (i.e. the one you have defined in jmInput()).
  • $media_id - the media_id is the "unique" ID that will be used to link this media file with the given entry. For example - if you are uploading a PDF file, and your module is for handling PDF files, then this ID MUST be the unique ID you have used in your PDF database table to differentiate the PDF files from each other (i.e. "pdf_id"). What this means is that you will be INSERTING/UPDATING your custom database table before you call this function - that way you have an ID to use for your media item.
  • $band_id - this is required so Jamroom knows what media directory to place the file in.


As long as you use this function for all media handling, Jamroom will handle all the "behind the scenes" work of ensuring the media file ends up in the proper location - it works across cluster servers as well.

- Brian
You must be logged in to post a comment
Solutions Products Support Community Company
Social Media Platform
Social Networking Software
Musician Website Manager
Community Builder
Jamroom 5
Jamroom 5 Modules
Jamroom Marketplace
Support Forum
Documentation
Support Center
Contact Support
Community Forum
Member Sites
Developers
About Us
Contact Us
Privacy Policy
©2003 - 2024 The Jamroom Network