I'm having issues with an image uploading form in Laravel.
On my localhost everything is working fine, but when i push to a server the images don't get passed to the controller.
The form has the enctype="multipart/form-data"
This is my form-field for the upload
<div class="form-group">
<div class="col">
<label for="photos">Add images here</label>
<input multiple="multiple" type="file" name="photos[]" class="form-control">
</div>
</div>
When is submit the form and put dd($request);
at the beginning of my controller, I get these responses:
Local:
+files: Symfony\Component\HttpFoundation\FileBag {#57 ▼
#parameters: array:1 [▼
"photos" => array:1 [▼
0 => Symfony\Component\HttpFoundation\File\UploadedFile {#42 ▼
-test: false
-originalName: "photo.jpg"
-mimeType: "image/jpeg"
-error: 0
path: "/private/var/tmp"
filename: "phpdwAuus"
basename: "phpdwAuus"
pathname: "/private/var/tmp/phpdwAuus"
extension: ""
realPath: "/private/var/tmp/phpdwAuus"
aTime: 2020-01-06 13:43:53
mTime: 2020-01-06 13:43:53
cTime: 2020-01-06 13:43:53
inode: 8623609813
size: 3142496
perms: 0100600
owner: 501
group: 0
type: "file"
writable: true
readable: true
executable: false
file: true
dir: false
link: false
}
]
]
}
Server:
+files: Symfony\Component\HttpFoundation\FileBag {#56 ▼
#parameters: []
}
The other fields get returned, and end up in the db. This problem is the same for the create and edit table