import { fileURLToPath } from 'url'
import path from 'path'
// Get the current file's directory
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
// Navigate to project root (app directory) and create uploads folder there
// From: src/personita/operations.ts
// Up to: src/personita/
// Up to: src/
// Up to: app/
const UPLOAD_DIR = path.join(__dirname, '..', '..', '..', 'uploads')
// Log the path to verify
console.log('Upload directory path:', UPLOAD_DIR)
// Ensure upload directory exists
if (!fs.existsSync(UPLOAD_DIR)) {
fs.mkdirSync(UPLOAD_DIR, { recursive: true })
console.log('Created upload directory:', UPLOAD_DIR)
}
import { fileURLToPath } from 'url'
import path from 'path'
// Get the current file's directory
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
// Navigate to project root (app directory) and create uploads folder there
// From: src/personita/operations.ts
// Up to: src/personita/
// Up to: src/
// Up to: app/
const UPLOAD_DIR = path.join(__dirname, '..', '..', '..', 'uploads')
// Log the path to verify
console.log('Upload directory path:', UPLOAD_DIR)
// Ensure upload directory exists
if (!fs.existsSync(UPLOAD_DIR)) {
fs.mkdirSync(UPLOAD_DIR, { recursive: true })
console.log('Created upload directory:', UPLOAD_DIR)
}