Support the ongoing development of Laravel.io →
Requests Input Validation

Hi,

I created a simple upload facility that will upload a file specifically a pdf file. Below is the controller of my upload

		if(Input::hasFile('my_pdf'))
		{
			if(Input::file('my_pdf')->move('/uploads'))
			{
				return "Uploaded";
			}
			else
			{
				return "No File";
			}
		}
		else
		{
			return "No File";
		}

After clicking the upload, it prompted that the file was successfully uploaded. But as i checked my public/uploads folder, no file was there.

Last updated 3 years ago.
0
...
if(Input::file('my_pdf')->move(public_path('uploads'), $fileName))
...

http://laravel.com/docs/4.2/requests#files

Last updated 3 years ago.
0

torosegon said:

...
if(Input::file('my_pdf')->move(public_path('uploads'), $fileName)
...

http://laravel.com/docs/4.2/requests#files

thanks torosegon

Last updated 3 years ago.
0

Mark as solved

Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.