Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

Uploading files via API

Premium
3:00

The Full Lesson is Only for Premium Members

Want to access all of our courses? (29 h 14 min)

You also get:

54 courses
Premium tutorials
Access to repositories
Private Discord
Get Premium for $129/year or $29/month

Already a member? Login here

Comments & Discussion

C
ccarlosm ✓ Link copied!

I am having trouble to do the same for update with PUT/PATCH method. Would it be better to create separate upload and delete image routes? Anyway let's suppose is necessary to create and update the category with both name and file in case is compulsory.

Moreover, have you got any article/video that explains how to create the route to get that file in API?

Thanks a lot!!

PK
Povilas Korop ✓ Link copied!

Wow, so many questions in one comment. Well, it's your personal preference how to implement it: separate or the same route for upload/delete. Depending on your situation and requirements from the front-end/UX/business teams.

Get that file in API: you mean download the physical file? There shouldn't be a route for that, it's an image/doc file so you can get it with the direct URL, no? Or, if you want to hide that file under some security check, I have this old article: Laravel: Upload File and Hide Real URL for Secure Download under UUID