How to Create a File Upload Progress Bar Using jQuery and Bootstrap

  Рет қаралды 48,288

Pretty Printed

Pretty Printed

Күн бұрын

Пікірлер: 103
@kennyaires7131
@kennyaires7131 5 жыл бұрын
By far the best Flask channel on youtube! it has everything. Thanks a lot!
@prettyprinted
@prettyprinted 5 жыл бұрын
Glad you think that. Thanks!
@parvathygs1810
@parvathygs1810 4 жыл бұрын
Thank you for this excellent video.. I implemented the same logic in django.. A file uploaded with progress bar successfully...I have a question : Could you please tell me how to use same logic for multiple fileupload with progress bar in django...?
@jasonsmith6826
@jasonsmith6826 3 жыл бұрын
Yes, please. I’d appreciate this as well.
@nalini6800
@nalini6800 7 жыл бұрын
Very good one from what all i searched so far!!! Please keep doing this great job.
@guinea_horn
@guinea_horn 4 жыл бұрын
Thanks for the video. I'm not sure if you'll see this but I've got a quick question 😊 I want to update a page with a value that changes overtime based on calculation on the backend, and maybe have a progress bar associated with that. How would I continuously update an element on the page based on data that comes from the backend, say, several times per second, without reloading the page each time?
@nimmero
@nimmero 3 жыл бұрын
Have you already worked it out? I have the same problem right now ... :D
@yomajo
@yomajo 2 жыл бұрын
@@nimmero Have YOU worked it out? :D
@BinaryBugs
@BinaryBugs 3 жыл бұрын
Great content Thanks!. Suppose If we want to send a input text data along with form. how to achieve that?
@poojakadam3443
@poojakadam3443 2 жыл бұрын
I implemented this code working fine, One of the best solution i found, nicely explained. I want to show progress bar for multiple file processing, can u please guide?
@pedropvf
@pedropvf 5 жыл бұрын
Thanks a lot for the succinct and clear example and explanation. It helped a lot
@prettyprinted
@prettyprinted 5 жыл бұрын
you're welcome! Thanks for watching.
@renzors
@renzors 8 жыл бұрын
Excellent explanation, Anthony. It helps a lot! Thank you so much.
@prettyprinted
@prettyprinted 8 жыл бұрын
I'm glad I could help.
@rushas
@rushas 4 жыл бұрын
This was very helpful. Thanks
@kamilpazik2414
@kamilpazik2414 8 жыл бұрын
Really great, thank you. Recently I'm wondering how to connect that with drag & drop, any good ideas ?
@prettyprinted
@prettyprinted 8 жыл бұрын
I could make a video on how to add drag & drop in the next few days. Thanks for watching!
@gurucode.studio
@gurucode.studio 8 жыл бұрын
Thanks dude , i enjoyed the video, and also it would be nice if we hide the progress bar by default so when the upload starting the progress bar get appeared, and again your channel is the best keep it like that :)
@prettyprinted
@prettyprinted 8 жыл бұрын
It should be as simple as giving the progress bar a hidden attribute and then removing it once the upload starts.
@naveentechhie
@naveentechhie 3 жыл бұрын
can you create video on step bar which should work responsive with backed
@davidbalague9311
@davidbalague9311 6 жыл бұрын
Excellent video, just what I was looking for. Well explained and detailed. Thanks!
@prettyprinted
@prettyprinted 6 жыл бұрын
You're welcome! Thanks for watching.
@eyonky6234
@eyonky6234 5 жыл бұрын
This wouldn't work with multiple files though. Any ideas how would be able to do that?
@gkcchief2802
@gkcchief2802 4 жыл бұрын
This is exactly what I was looking
@himansu979
@himansu979 6 жыл бұрын
Thank you so much for nice video. Do you have an example how to make drag and drop area for images using Flask. User should be able to drag an image and using flask should be able to save to some different folder.
@prettyprinted
@prettyprinted 6 жыл бұрын
I don't yet, but that's a good topic. I'll add it to my list of topics to cover.
@namrathasrimateti9119
@namrathasrimateti9119 4 жыл бұрын
Great Video sir!! It helped me a lot. I'm wondering if I need to upload multiple files how can the progress bar calculate avg of all those files. Any suggestions would be appreciated. Thank You!
@TheXSimulated
@TheXSimulated 5 жыл бұрын
Hi, just wondering if you have a video of how to create an image upload interface with image preview using Bootstrap elements? Thanks!
@prettyprinted
@prettyprinted 5 жыл бұрын
I don't, but I'll consider making one. Thanks for the idea.
@QUUBBLE
@QUUBBLE 7 жыл бұрын
hi, Great tutorial. I have a question: how to show the progress bar visible only at the time of upload and hidden at all other times using bootstrap (in this tutorial). thanks
@prettyprinted
@prettyprinted 7 жыл бұрын
Create the progress as hidden in HTML (style="display:none;") Then in the submit event function, you can show it with $(...).show();
@tirthrajput4483
@tirthrajput4483 4 жыл бұрын
every thing is explain well , but when i writing app.py program flask.ext.uploads not working give error '" from flask.ext.uploads import UploadSet,configure_uploads ModuleNotFoundError: No module named 'flask.ext' "
@AndyChamberlainMusic
@AndyChamberlainMusic 4 жыл бұрын
newer version of flask don't have the ext folder. All that import was doing was setting up file saving, so you can do that manually with normal python. I replaced line 14: filename = files.save(request.files["media"]) with this: file = request.files["media"] file.save("uploads/" + file.filename) However this has no checking for a good filename format so I'd suggest adding this import statement: from werkzeug.utils import secure_filename and then having the function look like this: @app.route("/upload", methods=["GET", "POST"]) def upload(): if request.method == "POST" and "media" in request.files: file = request.files["media"] filename = secure_filename(file.filename) file.save("uploads/" + filename) return render_template("upload.html")
@danielcardonamartinez3535
@danielcardonamartinez3535 5 жыл бұрын
Is there a way to do a progress bar with a runtime of a function from php?. Thanks for the video.
@gkcchief2802
@gkcchief2802 4 жыл бұрын
Thanks bro...u save my time
@pauldumanig
@pauldumanig 7 жыл бұрын
Hi! instead of determining the 'loaded' value from the actual bytes loaded, how do i suppose to get the value coming from the controller instead? I intend to implement it not with file upload, but with reports query from the DB.
@prettyprinted
@prettyprinted 7 жыл бұрын
That's a little more complicated. Just thinking about it now, you'd probably need to figure out a novel way of measuring progress of your report queries along with having some real time functionality (like Socket.IO) to push the progress percentage to the client. If you're interested, I offer coaching to help solve more complicated problems like this. You can read about it here: prettyprinted.com/coaching
@asn6543
@asn6543 3 жыл бұрын
I used exactly your code but my progress-bar percentage is not the file upoladed percentage. And the form is processing. Am I missing something?
@loaisiwas4483
@loaisiwas4483 3 жыл бұрын
In my application, after uploading the file, the page is redirecting to the file page, "return redirect(url_for('file_view', id = file.id))" where I have another view that shows the details of this file. I followed the video, the progress bar was added successfully, but the redirect no longer works. Tried doing a redirect from javascript, but it is possible to redirect to a static link, but I want to do a redirect and pass the id number of the uploaded file (the id is set by flask sqlalchemy) any solution please?
@charanch3318
@charanch3318 4 жыл бұрын
How to create a progressbar with percantage , when we call a web service through ajax call.
@lyndontan9594
@lyndontan9594 7 жыл бұрын
Great!! Tuts!. but i have a question my progressbar is already done but my upload file is still uploading.
@prettyprinted
@prettyprinted 7 жыл бұрын
Thanks. It's hard for me to tell you what's wrong with that description. How off is the sync between the bar and uploaded file?
@lyndontan9594
@lyndontan9594 7 жыл бұрын
Goodmorning! thanks for the reply ahm on your video in your console.log everytime your'e uploading a data the bytes and total size are incrementing while in part its already done for example if i have a size of "76025" it will not increment 1...76025 it will finished at 76025 thats why my progressbar already completed.
@yohankurniadi4999
@yohankurniadi4999 5 жыл бұрын
Hi Sir, how you upload the data? because I can't get the data uploaded into the folder,. the progress bar works until 100% and said "File uploaded!", but when I check into the folder, the file doesn't exist. Please advice. Thank You.
@NiteshSingh-yi1xi
@NiteshSingh-yi1xi 6 жыл бұрын
Hi Anthony I am trying to create a progress bar for a http get route which internally calls another rest api, the whole business logic is in my http get route if 200 it redirects to success route else error route. Now I am trying to bring progress bar so in jQuery I am able to make route call for the request and I am getting response as well but my next route i.e. the plan html which is not getting loaded could you please advise on what may be the issue.
@jinkaz2895
@jinkaz2895 4 жыл бұрын
how to send file with data(text) like i want to have a texbox for filename..?
@Amazoniacentral
@Amazoniacentral 4 жыл бұрын
Essa sunção xhr.upload.addEventListener('progress', function (e) {} não está funcionando no chrome e nem no firefox, o que houve? porque isso? já verifiquei em vários fóruns mas nada de resposta
@anikets4270
@anikets4270 8 жыл бұрын
Thanks for making these tuts man
@prettyprinted
@prettyprinted 8 жыл бұрын
You're welcome, and thanks for watching!
@maximerouhier2201
@maximerouhier2201 5 жыл бұрын
Thank you for what you're doing ! It helps a lot !
@smilebig3884
@smilebig3884 3 жыл бұрын
This is great, thanks man.
@kayajones9215
@kayajones9215 4 жыл бұрын
is there a way in my flask app that I can have a loading bar on one screen then when it reaches 100% or goes all the way through another screen loads??
@romansleonovs495
@romansleonovs495 5 жыл бұрын
How to make the same script but supporting multiple files and each file start upload after the previous finished?
@justynatajemnica3130
@justynatajemnica3130 6 жыл бұрын
I just sent all files (original directories) to server (and i checked on my Apache as well) and script do not working. When I select a file and click to send it then page i reload ang get info PAGE NOT FOUD
@nartiscoding
@nartiscoding 6 жыл бұрын
SAme problem
@mrhaite
@mrhaite 6 жыл бұрын
Hello, i just fetching json data using AJAX, with Rails any idea?
@prettyprinted
@prettyprinted 6 жыл бұрын
I don't have any Rails videos, but the idea is basically the same once you learn how to create endpoints in Rails.
@jerempatton
@jerempatton 5 жыл бұрын
Hello! I downloaded the files and ran them on my localhost. However neither the progress bar works, nor the console.log() seems to be working... any idea why? UPDATE: the progress seems to be running in the browser status bar instead of the itself!
@prettyprinted
@prettyprinted 5 жыл бұрын
Both are JavaScript based. Do you have JavaScript active in your browser?
@jerempatton
@jerempatton 5 жыл бұрын
@@prettyprinted thanks for your answer. Yes it is allowed on the browser (I also tried with firefox as a comparison and it does the same in the status bar). However, still no console logs or updated progress bar :/
@abhinavkaushik6817
@abhinavkaushik6817 4 жыл бұрын
how can i render html rather alert and pop up?
@carlospatricio6842
@carlospatricio6842 7 жыл бұрын
He, I would like to know how can I do a progress bar to change the page, I am new in python and I have a page to run ansible but this page is loading for a time and I want to put a progress bar for the users, please can you help me
@prettyprinted
@prettyprinted 7 жыл бұрын
Any progress bar has to be based on actual processing. So first thing you have to figure is how to measure the progress of some process. Then after that, you create the actual progress bar like I've done in this video.
@carlospatricio6842
@carlospatricio6842 7 жыл бұрын
thank you Sr, I needed a gif, I think is not correct but was so hard do that
@3e950
@3e950 5 жыл бұрын
how you setup IP address for opening .html template is it localhost for something
@vaishnav4750
@vaishnav4750 4 жыл бұрын
Try live server plugin...
@Hafiz9188
@Hafiz9188 6 жыл бұрын
Hello, i am using this code in word-Press jQuery ajax. instead of showing me the real time process it shows me all progress at once.. when i click on button ti Bytes loaded, Total size and percentage results display at once,
@jacobhenry7223
@jacobhenry7223 7 жыл бұрын
you are a good teacher
@prettyprinted
@prettyprinted 7 жыл бұрын
Thanks, I appreciate it!
@jacobhenry7223
@jacobhenry7223 7 жыл бұрын
good.... one day i will be like you in python programming because i use you videos for learning....and thank you for being open to African people like me........i love you
@MyFlabbergast
@MyFlabbergast 6 жыл бұрын
@@jacobhenry7223 African people are just as awesome as anyone else around the globe. And thanks a ton, @Pretty Printed.
@desectorconfeliox8860
@desectorconfeliox8860 6 жыл бұрын
Good video, helped me a lot!
@prettyprinted
@prettyprinted 6 жыл бұрын
Thanks for watching!
@chrisfraps589
@chrisfraps589 5 жыл бұрын
Hi can this be implemented on Django?
@prettyprinted
@prettyprinted 5 жыл бұрын
I'll see what I can do.
@allenteezyy2744
@allenteezyy2744 6 жыл бұрын
Sir why i'm getting FILE UPLOADED! when i click submit button even if i don't put any file on my input file. And if i put a video it says FILE UPLOADED! but when i check my UPLOAD FOLDER there's nothing in it. :/
@allenteezyy2744
@allenteezyy2744 6 жыл бұрын
I hope you get this sir. :(
@prettyprinted
@prettyprinted 6 жыл бұрын
For saving the file, do you have to correct directory setup? Also, this video covers a narrow use case, so it doesn't cover a case where a user doesn't behave as expected.
@tecnofest7683
@tecnofest7683 Жыл бұрын
It's good job. Thanks!
@prettyprinted
@prettyprinted Жыл бұрын
Thanks for watching!
@heavydestroyer71
@heavydestroyer71 8 жыл бұрын
Great work. Thanks you for sharing.
@prettyprinted
@prettyprinted 8 жыл бұрын
Thanks for watching!
@akshayrathore8739
@akshayrathore8739 7 жыл бұрын
thank u sir.., for sharing knowledge
@prettyprinted
@prettyprinted 7 жыл бұрын
Thanks for watching!
@ozcanyarimdunya
@ozcanyarimdunya 6 жыл бұрын
Simple and perfect. Thank you.
@prettyprinted
@prettyprinted 6 жыл бұрын
You're welcome!
@ashokkumar5581
@ashokkumar5581 5 жыл бұрын
Great video.
@nadiaochikh3304
@nadiaochikh3304 3 жыл бұрын
please why the code is not working????
@adesanyaadewale6001
@adesanyaadewale6001 7 жыл бұрын
Great Video. Thanks for this.
@prettyprinted
@prettyprinted 7 жыл бұрын
Thanks for watching!
@shanefilan7226
@shanefilan7226 7 жыл бұрын
Thanks dude, really helpful. And could u give us a copy of the sample code?
@prettyprinted
@prettyprinted 7 жыл бұрын
Here you go: s3.us-east-2.amazonaws.com/prettyprinted/upload_progress_bar_jquery.zip
@aggieaggie3946
@aggieaggie3946 4 жыл бұрын
mine has failed to function it just brings me errors
@tienatrom1624
@tienatrom1624 6 жыл бұрын
thank you so much
@prettyprinted
@prettyprinted 6 жыл бұрын
You're welcome! Thanks for watching.
@shibbirahmadosmani5896
@shibbirahmadosmani5896 7 жыл бұрын
Thanks
@prettyprinted
@prettyprinted 7 жыл бұрын
You're welcome! Thanks for watching.
@eugeneji6371
@eugeneji6371 5 жыл бұрын
how do I make slim progress bar>>?
@prettyprinted
@prettyprinted 5 жыл бұрын
It's just CSS changes.
@eugeneji6371
@eugeneji6371 5 жыл бұрын
@@prettyprinted Thanks!! American friend~
@carlossaulcastanedacastane1713
@carlossaulcastanedacastane1713 6 жыл бұрын
Thanks man
@prettyprinted
@prettyprinted 6 жыл бұрын
You're welcome! Thanks for watching.
File Upload Progress Bar Meter Tutorial HTML5 Ajax PHP
24:39
Adam Khoury
Рет қаралды 199 М.
Support each other🤝
00:31
ISSEI / いっせい
Рет қаралды 81 МЛН
Enceinte et en Bazard: Les Chroniques du Nettoyage ! 🚽✨
00:21
Two More French
Рет қаралды 42 МЛН
99.9% IMPOSSIBLE
00:24
STORROR
Рет қаралды 31 МЛН
How to Create a Celery Task Progress Bar in Django
21:25
Pretty Printed
Рет қаралды 45 М.
Vim Tips I Wish I Knew Earlier
23:00
Sebastian Daschner
Рет қаралды 82 М.
How to Create a Modal With HTMX Only (No JavaScript)
13:50
Pretty Printed
Рет қаралды 927
Axios upload progress with progress bar tutorial
15:16
OpenJavaScript
Рет қаралды 13 М.
How is this Website so fast!?
13:39
Wes Bos
Рет қаралды 1,2 МЛН
Google’s Quantum Chip: Did We Just Tap Into Parallel Universes?
9:34
How to Upload Files with Flask Using Python
11:04
Arpan Neupane
Рет қаралды 75 М.
Support each other🤝
00:31
ISSEI / いっせい
Рет қаралды 81 МЛН