Laravel的Storage :: put不基于原始上传的文件扩展名保存文件。 (例如,已上传的.ai保存为.pdf)

问题描述 投票:0回答:1

我正在尝试上传Adobe Illustrator(.ai)文件,并使用Storage :: put()将文件另存为pdf。

问题

这是上传的文件。

enter image description here

经过多次尝试,我已经确认它们都保存为.pdf。

enter image description here

您如何解决此问题?

laravel laravel-5.8
1个回答
0
投票

[窥探AI文件后,我发现这就是采用这种方式的原因。

enter image description here

我不明白为什么更改了保存文件的扩展名,但是使用Storage :: putFileAs()而不是Storage :: put()解决了我当前的问题。这很可能是Laravel框架中的错误。

© www.soinside.com 2019 - 2024. All rights reserved.