laravel - mkdir():在 IIS8 上的 laravel 上导出 Excel 文件时文件存在
问题描述
我正在尝试使用 maatwebsite/Excel 包从 laravel 导出 Excel 文件,并且在本地一切正常,但是当我想将它放在 IIS 服务器上时,出现此错误:
这是导致我的控制器中错误的代码:
$date = Carbon::now()->format("d-m-y-h-m-s");
$data1= json_decode( json_encode($data), true);
$export = new ExcelExport((array) $data1);
$file= Excel::store($export,storage_path('app')."\jobshistorie".$date.".xlsx", "local");
我将整个项目目录的权限授予了服务器。我在公共目录中也有 web.config 文件:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Rule 1" stopProcessing="true">
<match url="^(.*)/$" ignoreCase="false" />
<action type="Redirect" redirectType="Permanent" url="/{R:1}" />
</rule>
<rule name="Rule 2" stopProcessing="true">
<match url="^" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
我可以使用我能得到的所有帮助,谢谢!
解决方案
我想我迟到了,但你可以尝试清除缓存: php artisan config:cache 或 php artisan config:clear
希望它可能会有所帮助。
推荐阅读
- javascript - jquery .val('') 不起作用,留下 0 而不是清除字段
- javascript - 无法解决反应和节点应用程序中的cors错误
- android - Chromecast 的错误代码 2154 的定义是什么?
- powershell - 使用 Powershell Get-PnPFile 和 Add-PnPFile 将 SharePoint 下载/上传文件作为流
- django - 如何从 consumer.py django 访问用户信息?
- pyinstaller - Cx_Oracle 和 Pyinstaller
- c++ - 指向其他许多对象的有效成员指针
- ace-editor - 没有在光标所在的位置输入字符
- javascript - javascript中的哪个命令单击按钮name =“form:j_id15”?
- android - 如何在我的 Android 应用中仅播放来自 youtube 频道的直播视频?