Rohan
Rohan

Reputation: 13771

Add a progress bar in Laravel form?

I am working on a simple profile update form and I need to have a progress bar for the photo upload. I am new to this and have no clue where to begin.

I am trying to upload the file as an input field in the form with the type as file. With larger files, I cannot track if the upload has failed or frozen and would like a progress bar.

I can create a bar which is filling according to percentage but I still need to have the information from the server which I don't understand how.

I read somewhere that PHP 5.4 and above provides this information via the $_SESSION in the form of session.upload_progress.name but I also read somewhere else that Laravel does not use the conventional session and this won't work.

Is there a way to get this to work. I don't have a multiple image upload so I don't wish to install those third party libraries out there. I just want to keep it simple and somehow fetch the upload information from the server.

What is the simplest way to go around this problem?

Upvotes: 0

Views: 2063

Answers (1)

Laurence
Laurence

Reputation: 60038

The simplest way is to do it via jQuery and AJAX - using something like http://www.dropzonejs.com/ - which is awesome and very easy to use

Upvotes: 1

Related Questions