tidy up
This commit is contained in:
parent
31dd25331e
commit
31c6450f5e
|
@ -68,7 +68,6 @@ exports.uploadFile = async function(ctx) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function processLocalFileUploads({ files, outputPath, instanceId }) {
|
async function processLocalFileUploads({ files, outputPath, instanceId }) {
|
||||||
console.log("files", files)
|
|
||||||
// create attachments dir if it doesnt exist
|
// create attachments dir if it doesnt exist
|
||||||
!fs.existsSync(outputPath) && fs.mkdirSync(outputPath, { recursive: true })
|
!fs.existsSync(outputPath) && fs.mkdirSync(outputPath, { recursive: true })
|
||||||
|
|
||||||
|
@ -77,20 +76,13 @@ async function processLocalFileUploads({ files, outputPath, instanceId }) {
|
||||||
// filenames converted to UUIDs so they are unique
|
// filenames converted to UUIDs so they are unique
|
||||||
const processedFileName = `${uuid.v4()}.${fileExtension}`
|
const processedFileName = `${uuid.v4()}.${fileExtension}`
|
||||||
|
|
||||||
// {
|
|
||||||
// name: 'backspace-solid.svg',
|
|
||||||
// path: '/Users/martinmckeaveney/Downloads/backspace-solid.svg',
|
|
||||||
// size: 813,
|
|
||||||
// type: 'image/svg+xml'
|
|
||||||
// }
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
name: file.name,
|
name: file.name,
|
||||||
path: file.path,
|
path: file.path,
|
||||||
size: file.size,
|
size: file.size,
|
||||||
type: file.type,
|
type: file.type,
|
||||||
processedFileName,
|
processedFileName,
|
||||||
// extension: fileExtension,
|
extension: fileExtension,
|
||||||
outputPath: join(outputPath, processedFileName),
|
outputPath: join(outputPath, processedFileName),
|
||||||
url: join("/attachments", processedFileName),
|
url: join("/attachments", processedFileName),
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
<script>
|
<script>
|
||||||
// import { notifier } from "builderStore/store/notifications"
|
|
||||||
import { Heading, Body, Button } from "@budibase/bbui"
|
import { Heading, Body, Button } from "@budibase/bbui"
|
||||||
import { FILE_TYPES } from "./fileTypes"
|
import { FILE_TYPES } from "./fileTypes"
|
||||||
import api from "../api"
|
import api from "../api"
|
||||||
|
@ -124,7 +123,7 @@
|
||||||
</li>
|
</li>
|
||||||
{/if}
|
{/if}
|
||||||
</ul>
|
</ul>
|
||||||
<i class="ri-folder-upload-line" />
|
<i class="fas fa-upload" />
|
||||||
<input id="file-upload" type="file" multiple on:change={handleFile} />
|
<input id="file-upload" type="file" multiple on:change={handleFile} />
|
||||||
<label for="file-upload">Upload</label>
|
<label for="file-upload">Upload</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue