我正在尝试使用Laravel Storage Facade将文件上传到临时位置,并且它说该文件不存在.我正在尝试将文件上传到./storage/app/roofing/projects/{id}/then文件.不知道我到底哪里错了.
foreach ($files as $file) {
$path = Storage::putFile('contract-assets', new File('../storage/app/roofing/projects/'. $project->id.'/'. $file));
}
Run Code Online (Sandbox Code Playgroud)
我必须在将文件存储在我的本地服务器上之后将文件发送到AWS S3,因为尝试直接上传到S3需要一些时间,在我的情况下,由于需要存储的文件数量,它需要时间.截至目前,我所有的回复在我的dd()中都是正确的.可能是什么原因造成的?
if (!empty($request->contract_asset)) {
$files = $request->file('contract_asset');
foreach ($files as $file) {
Storage::putFile(Carbon::now()->toDateString().'/roofing/projects/'. $project->id.'/contract-assets', $file);
}
}
foreach (Storage::files(Carbon::now()->toDateString().'/roofing/projects/'.$project->id.'/contract-assets') as $file) {
dispatch(new ProcessRoofingProjectContractAssets($file, $project));
}
Run Code Online (Sandbox Code Playgroud)
我的工作档案.
/**
* Execute the job.
*
* @return void
*/
public function handle()
{
$path = Storage::disk('s3')->put('contract-assets', $this->asset, 'public');
dd($path);
$this->project->addContractAsset($path);
}
Run Code Online (Sandbox Code Playgroud)
更新:
这些是我当前的更改,我收到以下错误消息. Failed because Unable to JSON encode payload. Error code: 5
foreach ($files …Run Code Online (Sandbox Code Playgroud) Could not load file or assembly "Microsoft.VisualStudio.Services.Common, Version=12.0.21005.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a当我尝试使用下面的代码连接到我的TFS服务器(使用C#)时,我不断收到异常消息:
Uri tfsUri = (args.Length < 1) ?
new Uri("http://Server:Port/VDir") : new Uri(args[0]);
TfsConfigurationServer configurationServer = TfsConfigurationServerFactory.GetConfigurationServer(tfsUri);
Run Code Online (Sandbox Code Playgroud)
代码参考自:
https://msdn.microsoft.com/en-us/library/bb286958(v=vs.120).aspx
在我的本地系统或互联网上找不到这个dll- " Microsoft.VisualStudio.Services.Common ".
你能帮忙解决我错过的问题吗?