Carlos Eduardo Gatti Ferreira

QRACK Uploads Directory Setup

Problem

QRACK uploads are failing because the required upload directory does not exist on the server.

Server Context

Existing Directories

The following directories already exist:

Solution

Option 1: Manual Creation (Quick Fix)

SSH into the server and run:

cd /home/boxhub/boxhub-api/uploads
mkdir -p qrack-items
chmod 755 qrack-items

Update the backend upload handler to automatically create the directory if it doesn’t exist, following the same pattern used for other upload directories.

Example Node.js/Express pattern:

const fs = require('fs').promises;
const path = require('path');

const uploadDir = path.join(__dirname, '../uploads/qrack-items');

// Ensure directory exists
try {
  await fs.mkdir(uploadDir, { recursive: true });
} catch (error) {
  console.error('Failed to create upload directory:', error);
  throw error;
}

Example PHP/Laravel pattern:

$uploadPath = storage_path('app/public/uploads/qrack-items');

if (!File::exists($uploadPath)) {
    File::makeDirectory($uploadPath, 0755, true);
}

Permissions

Verification

After creating the directory, verify:

  1. Directory exists: ls -la /home/boxhub/boxhub-api/uploads/ | grep qrack
  2. Permissions are correct: stat /home/boxhub/boxhub-api/uploads/qrack-items
  3. API process can write: Test upload via QRACK frontend

Notes