Hi,
I tried to test file upload by using \Symfony\Component\HttpFoundation\File\UploadedFile
I created the instance by using:
$file = new \Symfony\Component\HttpFoundation\File\UploadedFile(base_path('resources/data/test.jpg'),'test.jpg');
However, when the instance is created, it seems the size can't be read, I dd() it, and it showed
Symfony\Component\HttpFoundation\File\UploadedFile {#494
-test: false
-originalName: "test.jpg"
-mimeType: "application/octet-stream"
-size: null
-error: 0
}
And, the file was null when it was read by the API.
Any idea, what's wrong with this?
PS. I migrated the tests from L4.2, the codes work properly before I moved to L5.1