6 months ago

Vapor uploading files

Posted 6 months ago by theUnforgiven

Hi all,

I have my AWS all setup in .env and Vapor deploy all works etc. But I have a new Vue component, to upload files.

    <div class="mt-2 mb-2 mr-2">
        <input type="file" id="file" ref="file" @change="upload" class="form-control">
        <div v-if="isUploaded">
            <div class="alert alert-success">File uploaded successfully</div>

    export default {

        data() {
            return {
                isUploaded: false,

        methods: {
            upload() {
      $refs.file.files[0], {
                    progress: progress => {
                        this.uploadProgress = Math.round(progress * 100);
                }).then(response => {
          '/api/file/upload', {
                        uuid: response.uuid,
                        key: response.key,
                        bucket: response.bucket,
                        name: this.$refs.file.files[0].name,
                        content_type: this.$refs.file.files[0].type,

                    this.isUploaded = true;

But I'm seeing these errors and not sure why, as I have followed the Vapor docs.

Any help greatly appreciated

cc @themsaid

Please sign in or create an account to participate in this conversation.