Level 102
What is the error?
Also if you want to store it on aws, you should use the storage facade directly. Dont run fopen on it.. It has methods for the things you can do
I want to create a csv file on the run time and store it in the aws s3 bucket but I am unable to do so. Here is my code. Please help me resolve this issue.
```
$file = fopen(Storage::disk('s3')->put('/clean_sheet/', $path), "w");
$i = 1;
foreach ($cleanSheetss as $key => $cleanSheet) {
if ($i == 1) {
fputcsv($file, array("Retailer Name", "Location", "Province", 'SKU', "Brand", "product Name", "Category", "Sold", "Purchased", "Average Price", "Average Cost", "Flag", "Comments"));
} else {
fputcsv($file, $cleanSheet->toArray());
}
$i++;
}
fclose($file);
```
Please or to participate in this conversation.