This commit is contained in:
Martin McKeaveney 2020-09-23 21:03:13 +01:00
parent 31dd25331e
commit 31c6450f5e
2 changed files with 2 additions and 11 deletions

View File

@ -68,7 +68,6 @@ exports.uploadFile = async function(ctx) {
}
async function processLocalFileUploads({ files, outputPath, instanceId }) {
console.log("files", files)
// create attachments dir if it doesnt exist
!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
const processedFileName = `${uuid.v4()}.${fileExtension}`
// {
// name: 'backspace-solid.svg',
// path: '/Users/martinmckeaveney/Downloads/backspace-solid.svg',
// size: 813,
// type: 'image/svg+xml'
// }
return {
name: file.name,
path: file.path,
size: file.size,
type: file.type,
processedFileName,
// extension: fileExtension,
extension: fileExtension,
outputPath: join(outputPath, processedFileName),
url: join("/attachments", processedFileName),
}

View File

@ -1,5 +1,4 @@
<script>
// import { notifier } from "builderStore/store/notifications"
import { Heading, Body, Button } from "@budibase/bbui"
import { FILE_TYPES } from "./fileTypes"
import api from "../api"
@ -124,7 +123,7 @@
</li>
{/if}
</ul>
<i class="ri-folder-upload-line" />
<i class="fas fa-upload" />
<input id="file-upload" type="file" multiple on:change={handleFile} />
<label for="file-upload">Upload</label>
</div>