Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit dd039fc

Browse files
authoredApr 22, 2025··
Fix bug when Cloudinary storage adapter was not working correctly on Windows (#150)
1 parent 01e867e commit dd039fc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed
 

‎src/CloudinaryStorageAdapter.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,12 @@ public function checksum(string $path, Config $config): string
194194
public function prepareResource(string $path): array
195195
{
196196
$info = pathinfo($path);
197-
$id = $info['dirname'].DIRECTORY_SEPARATOR.$info['filename'];
197+
198+
// Ensure dirname uses forward slashes, regardless of OS
199+
$dirname = str_replace('\\', '/', $info['dirname']);
200+
// Always use forward slash for path construction
201+
$id = $dirname.'/'.$info['filename'];
202+
198203
$mimeType = $this->mimeTypeDetector->detectMimeTypeFromPath($path);
199204

200205
if (strpos($mimeType, 'image/') === 0) {

1 commit comments

Comments
 (1)

Abdulmoeidkhan commented on Apr 23, 2025

@Abdulmoeidkhan

nice job you have fix this i have been working on this since morning and thinking what am i doing wrong

Please sign in to comment.