24 lines
425 B
JavaScript
24 lines
425 B
JavaScript
'use server'
|
|
|
|
/**
|
|
* Deprecated
|
|
* 개발후 삭제 예정
|
|
*/
|
|
|
|
import fs from 'fs/promises'
|
|
|
|
const imageSavePath = 'public/cadImages'
|
|
|
|
const convertDwgToPng = async (fileName, data) => {
|
|
console.log('fileName', fileName)
|
|
try {
|
|
await fs.readdir(imageSavePath)
|
|
} catch {
|
|
await fs.mkdir(imageSavePath)
|
|
}
|
|
|
|
return await fs.writeFile(`${imageSavePath}/${fileName}`, data, 'base64')
|
|
}
|
|
|
|
export { convertDwgToPng }
|