<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/file-upload-made-easy-in-laravel-zhi4lxa4l" -->

---
title: File Upload Made Easy in Laravel | daily.dev
description: Learn how to efficiently handle file uploads in Laravel by storing the complete path in the database, and ensure accessibility by creating a symlink from...
canonical: https://daily.dev/posts/file-upload-made-easy-in-laravel-zhi4lxa4l
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: File Upload Made Easy in Laravel | daily.dev
og:description: Learn how to efficiently handle file uploads in Laravel by storing the complete path in the database, and ensure accessibility by creating a symlink from...
og:url: https://daily.dev/posts/file-upload-made-easy-in-laravel-zhi4lxa4l
og:image: https://api.daily.dev/og/posts/ZHI4lXa4L.png
og:image:alt: File Upload Made Easy in Laravel
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# File Upload Made Easy in Laravel

**[Community Picks](https://daily.dev/sources/community)** · 1 min read · 30 upvotes · 6 comments

## Summary

Learn how to efficiently handle file uploads in Laravel by storing the complete path in the database, and ensure accessibility by creating a symlink from storage to public using `php artisan storage:link`.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://msamgan.com/file-upload-made-easy-in-laravel>

## Community discussion

Top comments from developers on daily.dev.

**@tarikmanoar** · 2 upvotes

> it's more simple like
> $request->file('file')->store('path', 'public|local|s3');

**@gds87** · 1 upvotes

> I prefer a memory-efficient approach like streaming the file to disk using [Storage::putFile()](https://laravel.com/docs/11.x/filesystem#automatic-streaming)

**@arafathossainar** · 1 upvotes

> When I was junior dev. I used to use 3–4 lines of code to get a file path. 🤣🤣

---

Tags: [#webdev](https://daily.dev/tags/webdev), [#php](https://daily.dev/tags/php), [#laravel](https://daily.dev/tags/laravel)

[View this post on daily.dev](https://daily.dev/posts/file-upload-made-easy-in-laravel-zhi4lxa4l)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"File Upload Made Easy in Laravel","url":"https://daily.dev/posts/file-upload-made-easy-in-laravel-zhi4lxa4l","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/file-upload-made-easy-in-laravel-zhi4lxa4l"},"datePublished":"2024-07-04T03:18:35.262Z","dateModified":"2024-08-23T15:50:40.833Z","description":"Learn how to efficiently handle file uploads in Laravel by storing the complete path in the database, and ensure accessibility by creating a symlink from...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/9ca5b28359d76f6ce3f52d33eaf17eba?_a=AQAEuiZ","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/9ca5b28359d76f6ce3f52d33eaf17eba?_a=AQAEuiZ","isAccessibleForFree":true,"articleSection":"Community Picks","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Community Picks","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1655817725/logos/community","url":"https://daily.dev/sources/community"},"commentCount":6,"discussionUrl":"https://daily.dev/posts/file-upload-made-easy-in-laravel-zhi4lxa4l","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":30},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":6}],"keywords":"webdev,php,laravel","timeRequired":"PT1M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Community Picks","item":"https://daily.dev/sources/community"},{"@type":"ListItem","position":3,"name":"File Upload Made Easy in Laravel"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/file-upload-made-easy-in-laravel-zhi4lxa4l","comment":[{"@type":"Comment","text":"it’s more simple like\n$request-\u0026gt;file(‘file’)-\u0026gt;store(‘path’, ‘public|local|s3’);","datePublished":"2024-07-08T06:19:08.944Z","url":"https://daily.dev/posts/ZHI4lXa4L#c-7ZvExx3PE","author":{"@type":"Person","name":"Tarik Manoar","url":"https://daily.dev/tarikmanoar","image":"https://lh3.googleusercontent.com/a/ACg8ocJsCITjGdgeiKJO7Y9Bucj7Q6KPTeiOgNTL11ALRdQpPEyeinjq2Q=s96-c"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2}},{"@type":"Comment","text":"I prefer a memory-efficient approach like streaming the file to disk using Storage::putFile()","datePublished":"2024-07-15T14:51:25.148Z","dateModified":"2024-07-15T14:52:26.287Z","url":"https://daily.dev/posts/ZHI4lXa4L#c-hV01peDZP","author":{"@type":"Person","name":"Giandomenico Di Salvatore","url":"https://daily.dev/gds87","image":"https://lh3.googleusercontent.com/a/AATXAJyhbTIM0cKJqJfSPfOCno5sXE0c0TJJUAeZAjIP=s100"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}},{"@type":"Comment","text":"When I was junior dev. I used to use 3–4 lines of code to get a file path. 🤣🤣","datePublished":"2024-07-13T14:05:11.106Z","url":"https://daily.dev/posts/ZHI4lXa4L#c-faKdeLh1j","author":{"@type":"Person","name":"Arafat Hossain Ar","url":"https://daily.dev/arafathossainar","image":"https://avatars.githubusercontent.com/u/26932301?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}}]}
```

