The uploader is how content enters XOM. It handles file selection, classification, transfer to storage, and creation of the post record — in one flow, from the feed, without a separate publishing tool.
01The upload flow
A post is assembled from four inputs: the media, a short description, a content type, and an industry.
Media can be a single image, a single video, an image carousel (multiple images uploaded in one action), or an external URL with no file at all. The uploader detects file type from the browser's MIME type and branches accordingly. Description is capped at 280 characters with a live counter that warns as the limit approaches.
Content type is chosen through a nested selector that mirrors XOM's container taxonomy: first one of six categories — collaborative, dynamic, elements, external, intelligent, programmable — then the specific module within it. That pairing is stored on the post as a single category/type string, which is the value the container handler later reads to decide which renderer to load. Industry is a required selection from XOM's industry list, and is stored lowercased so it matches the feed's filtering keys.
02What happens on submit
Files are transferred to Firebase Storage using a resumable upload, which reports progress back to the interface as it runs. Media is written under a Feeds/{Image|Video}/ prefix with a timestamped filename. For carousel uploads, files are uploaded sequentially and the resulting URLs collected into an array.
Once transfer completes, the uploader writes a single post record to the Realtime Database containing the body text, creation timestamp, the media URL or the carousel array, the owner's UID, the category/type content type, the post metadata reference, any external URL, the industry, and a numeric type code that distinguishes image, video, link, and carousel posts.
Two guards run before any transfer begins: the user must be authenticated, and the shared demo account is explicitly blocked from uploading. On failure the flow surfaces an error and leaves the form populated rather than discarding the user's input; on success it clears the media and text but deliberately keeps the content type and industry selected, since consecutive uploads usually share them.
03Credits
XOM's credit system defines per-operation costs for uploads — separate rates for image, video, and audio uploads, and a higher rate for premium containers — with credit movements recorded as typed transactions (purchase, subscription, promotion, usage, refund) against the user's balance. Confirm current rates and whether charging is active before quoting numbers to a customer.