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 }) { 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),
} }

View File

@ -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>