Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

thesimons's avatar

Does Laravel come with a set of instrument to check uploaded files?

Hello,

When it comes to uploading files I'm always paranoid about security. All users are malicious to my eyes. I'm exaggerating, I know.

I'm going to upload files (videos and pictures) using a form. Is there any tools offered by Laravel to check the integrity of the files? I example if images are real images and videos are real videos?

Mime-type can be spoofed. So maybe something deeper.

Thanks, Simon

0 likes
4 replies
Snapey's avatar

No, nothing as standard. Validate using Mime types and don't use anything provided by the user (filename or extension)

1 like
Snapey's avatar

And put the file in a place that cannot be opened from the web.

1 like

Please or to participate in this conversation.