<div class="form-group">
<label>Attachment</label>
<input type="file" id="import-file" name="file" class="form-control" ref="file" @change="onFileChange" multiple>
<button type="button" class="btn btn-primary" v-on:click="submitPage">Submit</button>
</div>
onFileChange(e){
var self = this
self.file = e.target.files ? self.$refs.file.files[0] : null;
},
submitPage(){
const formData = new FormData();
formData.append('file', self.file);
const headers = { 'Content-Type': 'multipart/form-data' };
axios.post('/api/upload', formData, headers)
.then(function(response){
console.log(response.data)
})
.catch(function (err) {
console.log(err)
})
}
$file_extension = $request->file->getClientOriginalExtension();
$file_upload = Storage::disk('s3')->put('/folder_name', $request->file);
$file_path = Storage::disk('s3')->url($attach);
AWS_ACCESS_KEY_ID=access_key
AWS_SECRET_ACCESS_KEY=secret_key
AWS_DEFAULT_REGION=region
AWS_BUCKET=bucket_name
AWS_USE_PATH_STYLE_ENDPOINT=false