pqina / vue-filepond

🔌 A handy FilePond adapter component for Vue
https://pqina.nl/filepond
MIT License
1.92k stars 128 forks source link

load initial image from s3 #195

Closed elahekaramzade closed 3 years ago

elahekaramzade commented 3 years ago

I want to load the initial image from s3 in vue-file-pond, but it sends Xhr request to s3 and blocked by cors origin policy.( I don't use server side option because I submit image via form . ). Here is my file pond tag

            <file-pond
                style="width: 100px; height: 100px"
                name="image"
                ref="image"
                label-idle="Drop files here or <span class='filepond--label-action'>Browse</span>"
                :allow-multiple="false"
                accepted-file-types="image/*"
                style-panel-layout="compact circle"
                image-preview-height="70"
                image-crop-aspect-ratio="1:1"
                image-resize-target-width="100"
                image-resize-target-height="100"
                @removefile="removefile(category.image, 'image')"
                @addfile="addImage"
                v-bind:files="image"
              />

              ---------------------------------
        data(){return{
                  image: this.category.image
                  ? [this.storage_url + this.category.image]
                : "",}
           }
               ,
     methods:{
     addImage() {
               this.form.image = this.$refs.image.getFile().file;
            }, 
     }

storage_url is my s3 base URL. It loads simply on img tag but in file pond ... what can I do? I had a full week with nightmare :(( plz help.

rikschennink commented 3 years ago

https://github.com/pqina/filepond/issues/655