Level 51
The file is getting uploaded to S3 it seems, so not sure why the error is showing and also why it's not setting the files visibility to public.
Any advice/help greatly appreciated.
HI all,
I am getting the following error and unable to set the file visibility to public.

I also want it moving from the tmp directory too, which I though this code did:
$replace = str_replace('tmp/', '', $request->input('key'));
$stored = '/uploads/' . user()->id . '/legal/' . $request->input('key');
$moved = Storage::move($replace, $stored);
Storage::setVisibility(str_replace('tmp/', '', $stored, 'public'); //This doesn;'t set to public either
Vue
<form method="post" enctype="multipart/form-data" @submit.prevent="uploadFile">
<input type="file" name="file" id="file" ref="file">
<button type="submit" class="btn btn-sm btn-outline-success">Upload</button>
<div class="mt-3 mb-3" v-if="uploadProgress">
<span class="alert alert-success">Upload Complete</span>
</div>
</form>
Then the method within Vue:
uploadFile() {
Vapor.store(this.$refs.file.files[0], {
progress: progress => {
setTimeout(() => {
this.uploadProgress = Math.round(progress * 100);
}, 1000);
}
}).then(response => {
axios.post('/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,
url: response.url,
optional: this.optional,
property_id: this.property_id,
});
setTimeout(() => {
swal({
title: 'Success!',
text: 'File successfully uploaded and saved.',
icon: 'success',
button: 'Continue',
});
}, 1300);
this.uploadProgress = false;
});
}
Please or to participate in this conversation.