尝试使用DigitalOcean的Spaces而不是AWS(他们的UI可以在地狱中燃烧)
当我使用DropzoneJS上传视频(364 kb进行测试)时说它已成功上传,但由于某种原因它不在我的DigitalOcean存储中,这没有任何意义,它会抛出如果失败了就会出错?
这是代码
HTML
<form action="/post/uploadReel" class="dropzone" id="reelUpload">
{{csrf_field()}}
</form>
<script>
Dropzone.options.photoUpload = {
maxFilesize:200,
acceptedFiles: ".mp4,.avi,.flv,.mov",
paramName: "video",
parallelUploads: 1,
maxFiles:5,
dictInvalidFileType: 'This file type is not supported',
dictFileTooBig:'File size too big',
addRemoveLinks: true,
init: function() {
this.on('success', function(file, serverFileName) {
file.serverFileName = serverFileName;
}),
this.on('removedfile', function(file) {
sendData('/post/deleteReel',
{'name':file.serverFileName},
function(msg) {
toastr.success('Deleted Reel');
},
function(msg) {
toastr.error('Server error deleting reel');
});
});
}
};
</script>
PHP
$User = Auth::user();
$Uploads = Request::get('video');
$Files = $User->GetUserVideos();
if(!$User->subscribed() && count($Files) > 0) {
return "Max Uploads Reached";
} elseif($User->subscribed() || count($Files) === 0) {
$name = $Uploads->hashName();
Storage::disk('spaces')->putFile($name, $Uploads);
$Reel = Reels::create();
$Reel->name = $name;
$Reel->user_id = $User->id;
$Reel->save();
}
return "Uploaded Reel";
另外,一方面,有声誉的人可以创建数字海洋空间的标签吗?我认为这会使社区受益
由于
答案 0 :(得分:0)
固定。
问题是Dropzone正在发送名为=&#34; file&#34;的文件。从理论上讲,它应该是名称=&#34;视频&#34;