Skip to content
Products
Resources
Solutions
Pricing
Contact
Log In
Sign Up
Docs
Getting Started
Configuration
Apps
CODE
Developer Architecture
Code Convention
Code Quality
Directory Structure
Storage System
Common Mistakes
Payment Provider Integration
How to Add an App
Auth
Docs
CODE
Storage System
On this page

Storage System

How UNA 15 stores and serves files through storage objects, local and remote engines.
Android
iOS
Web
Core
~15.0
Copy Page
Note
'OBJECT_STORAGE' => 'bx_posts_covers',
'OBJECT_STORAGE_FILES' => 'bx_posts_files',
'OBJECT_STORAGE_PHOTOS' => 'bx_posts_photos',
'OBJECT_STORAGE_VIDEOS' => 'bx_posts_videos',
'OBJECT_STORAGE_SOUNDS' => 'bx_posts_sounds',
$oStorage = BxDolStorage::getObjectInstance($this->_oConfig->CNF['OBJECT_STORAGE']);
if (!$oStorage)
	return false;

$iFileId = $oStorage->storeFileFromForm($_FILES['file'], true, $iProfileId);
if ($iFileId === false) {
	// $oStorage->getErrorString() / getErrorCode()
	return false;
}

// persist $iFileId on your content row, then clear the ghost
$oStorage->afterUploadCleanup($iFileId, $iProfileId);

$sUrl = $oStorage->getFileUrlById($iFileId);
$aFile = $oStorage->getFile($iFileId);
16d
On this page
EnginesRegister an objectUse the APIServe URLsGhostsNot this page
Auto
'OBJECT_STORAGE' => 'bx_posts_covers',
'OBJECT_STORAGE_FILES' => 'bx_posts_files',
'OBJECT_STORAGE_PHOTOS' => 'bx_posts_photos',
'OBJECT_STORAGE_VIDEOS' => 'bx_posts_videos',
'OBJECT_STORAGE_SOUNDS' => 'bx_posts_sounds',
$oStorage = BxDolStorage::getObjectInstance($this->_oConfig->CNF['OBJECT_STORAGE']);
if (!$oStorage)
	return false;

$iFileId = $oStorage->storeFileFromForm($_FILES['file'], true, $iProfileId);
if ($iFileId === false) {
	// $oStorage->getErrorString() / getErrorCode()
	return false;
}

// persist $iFileId on your content row, then clear the ghost
$oStorage->afterUploadCleanup($iFileId, $iProfileId);

$sUrl = $oStorage->getFileUrlById($iFileId);
$aFile = $oStorage->getFile($iFileId);